I tried running the Angular sample in Auth0 Quick Start with Docker

When I looked into each sample source of Auth0, it prepared Dockerfile, so I tried to build the environment.

About Auth0

Please refer to the outline below.

I checked the function of Auth0 --Qiita https://qiita.com/kai_kou/items/b3dd64e4f8f53325020e

Auth0 is iDaaS provided by Auth0, Inc., which stands for Identity as a Service and provides ID management and authentication functions in the cloud. Functions provided by iDaaS include authentication / single sign-on, ID management / linkage, authorization, and auditing using logs, and Auth0 also provides them.

Account creation

Please refer to the following for creating an Auth0 account.

I tried the Auth0 JavaScript tutorial with a simple configuration --Qiita https://qiita.com/kai_kou/items/51ce27a8f98a14263e26#%E3%82%A2%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B

Auth0 settings

Once you have an Auth0 account, set up Auth0 to use in the sample app.

Application settings

Open the Application screen with "Applications" on the left menu of the dashboard of Auth0, and open the setting of "Default App" from the beginning. image.png

Set and save the Application URIs as follows. http: // localhost: 4200 is the URL of the sample app.

Creating an API

Since the Angular sample uses the Custom API of Auth0, create the API. Open the API screen from "APIs" on the left menu of the Auth0 dashboard, and click the "+ CREATE API" button. image.png

Set as follows in the API creation dialog.

--Name: Any name (here angular)

image.png

Universal login settings

Select "Universal Login" from the Auth0 dashboard left menu and change Experience to New.

image.png

This completes the settings on the Auth0 side.

Get URL of sample source

Get the sample source for Angular. Select "Applications" from the left menu of the Auth0 dashboard, open the Application "Default App", and select the "Quick Start" tab. image.png

If you select Angular, a tutorial using Auth0 will be displayed. image.png

Click the "VIEW ON GIT HUB" button in "I want to explore a sample app" to display the Github page. image.png

Go up to the root of the GitHub repository and get the repository URL from "Code". image.png

Build / execute sample source

Clone the repository from GitHub, prepare the necessary configuration files, create a Docker image, and run the container. Get the domain and clientId from the Auth0 "Default App" application. image.png

>cd any directory
>git clone https://github.com/auth0-samples/auth0-angular-samples.git
>cd auth0-angular-samples/Sample-01

>cat << EOF > auth_config.json
{
  "domain": "<Own domin>",
  "clientId": "<Own clientId>",
  "audience": "http://localhost:3001",
  "apiUri": "http://localhost:3001",
  "appUri": "http://localhost:4200"}
EOF

>docker build -t auth0-angular-samples ./

>docker run -it --rm -p 3000:4200 -p 4200:3001 auth0-angular-samples


> [email protected] prod /app
> npm-run-all --parallel server:app server:api


> [email protected] server:app /app
> node server.js


> [email protected] server:api /app
> node api-server.js

App server listening on port 4200
Api started on port 3001

Try to run

Once the Docker container is up, open http: // localhost: 4200 in your browser. When the Angular app opens, click the "Log in" button in the upper right corner. image.png

After transitioning to the Auth0 login screen, log in with your email address or Google. image.png image.png

If you can log in, the upper right corner will change to the logged-in status. The profile image is (probably) not displayed because I have http, but I was able to do what I wanted to do this time. Wow image.png

You can also check the information of the logged-in user from the "Profile" menu in the upper right menu. image.png

Summary

It is helpful to have a very good sample to check the function of Auth0 quickly.

reference

I checked the function of Auth0 --Qiita https://qiita.com/kai_kou/items/b3dd64e4f8f53325020e

I tried the Auth0 JavaScript tutorial with a simple configuration --Qiita https://qiita.com/kai_kou/items/51ce27a8f98a14263e26#%E3%82%A2%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B

Recommended Posts

I tried running the Angular sample in Auth0 Quick Start with Docker
I tried installing the Docker Integration plugin in IntelliJ
I tried the Docker tutorial!
I tried BIND with Docker
I tried running WordPress with docker preview on M1 Mac.
I tried to build the environment of PlantUML Server with Docker
I tried running Docker on Windows Server 2019
I tried using Scalar DL with Docker
I tried the new era in Java
I tried the AutoValue library in Intellij
I tried to build a Firebase application development environment with Docker in 2020
I tried to solve the tribonacci sequence problem in Ruby, with recursion.
I tried running the route search engine (OSRM) easily with a container
I tried running gRPC's Quick Start (Kotlin version), but it was difficult to read the Gradle script.
I tried using Docker for the first time
I tried to organize the session in Rails
I tried touching Docker for the first time
I tried running Ansible on a Docker container
I tried to organize the cases used in programming
I tried to summarize the state transition of docker
[Rails] I tried playing with the comment send button
[WIP] I tried the configuration of Docker + Streama + NFS
I tried to implement the Euclidean algorithm in Java
I tried running Autoware
I tried to make an introduction to PHP + MySQL with Docker
I tried to increase the processing speed with spiritual engineering
Wait for the container service to start with docker healthcheck
I tried to build the environment little by little using docker
I tried to build the environment of WSL2 + Docker + VSCode
I tried running a Docker container on AWS IoT Greengrass 2.0
I tried to create a padrino development environment with Docker
I tried using the CameraX library with Android Java Fragment
I tried upgrading from CentOS 6.5 to CentOS 7 with the upgrade tool
I tried to make the "Select File" button of the sample application created in the Rails tutorial cool
I tried DI with Ruby
I tried the VueJS tutorial!
I tried the FizzBuzz problem
I tried UPSERT with PostgreSQL.
I tried metaprogramming in Java
I tried to solve the problem of "multi-stage selection" with Ruby
I tried to summarize the words that I often see in docker-compose.yml
I tried to illuminate the Christmas tree in a life game
I tried running a letter of credit transaction application with Corda 1
I tried to sort the data in descending order, ascending order / Rails
I tried to implement the image preview function with Rails / jQuery
What I did when the DB did not start with docker-compose up
I tried deploying a Docker container on Lambda with Serverless Framework
I tried to check the operation of gRPC server with grpcurl
[Java] I want to perform distinct with the key in the object
Stupid mistake I made when running nginx server with Docker Compose
I tried to solve the past 10 questions that should be solved after registering with AtCoder in Java
I tried to make a sample program using the problem of database specialist in Domain Driven Design