-
Notifications
You must be signed in to change notification settings - Fork 0
About
This project consists of the centralized web services that can be used by other MIDAS-Network applications. It is a Java web application based on Spring Boot, Spring Security, Thymeleaf, Maven, and Auth0 (http://auth0.com).
An overview of the protocol (defined by Auth0 in https://auth0.com/docs/protocols#oauth-server-side) is shown in the picture below:
(For this example the app will be deployed with /dev
as context and 9000 as port)
-
Authorize: The Auth0 script (lock.js) in auth0Login.html prompts the user to sign in. After the user chooses an identity provider (e.g. Google, Facebook), lock.js sends an authorization request to Auth0.
-
Authenticate: Next, Auth0 redirects the user to the identity provider to authenticate the user. This step may be skipped if the user is already signed in with the provider.
-
Code: If the user is authenticated, Auth0 will redirect to the URL provided as the
callbackURL
field in auth0Login.html (http://localhost:9000/dev/callback) withcode
andstate
as query parameters. -
Code: Then the
doGet
method of the configured servlet,Auth0ServletCallback
(com.auth0::auth0-servlet
), handles the redirection. -
Get Access Token: The method fetches the token and the user profile from Auth0 and stores them into the HTTP Session. The browser will be redirected to the configured URL (http://localhost:9000/dev/auth0) by the
redirectCallback
Bean handled by methodprocessAuth0Login
of classAuth0LoginController
. The method saves the user profile asAuth0User
. ThisAuth0User
is used as ModelAttribute in other Controllers. Finally, it redirects to http://localhost:9000/dev/terms.
$ git clone https://github.com/midas-isg/midas-hub
Run Application.main
just as a Java application.
-
Download the source code (see Downloading source code).
-
Run
./start.sh
. (If this is the first run, it will fail because the previous step forces you to override the application properties, so edit theconfig/application.properties
file to match auth0.com and your application settings.) -
Run
./start.sh
again.