-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sample application to function with updated OIDC platform at c…
…urrent-environment
- Loading branch information
Heikki Palm Henriksen
committed
May 7, 2018
1 parent
e3c9067
commit 059f34a
Showing
7 changed files
with
66 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,33 +2,38 @@ | |
This is a Java based test application for authenticating a user with BankID OpenID Connect Server (BID OIDC) developed for BankID Norge AS. | ||
When the user is authenticated you will see the result from a call to UserInfo RESTful service and the contents of the id_token which was returned from BID OIDC. | ||
|
||
## NOTE | ||
This client uses the stable CURRENT-environment, which is set up with the BankID Preprod user-database. | ||
New test-users can be created self-serviced at https://ra-preprod.bankidnorge.no/ | ||
|
||
|
||
## Process flow | ||
The application examplifies all steps of the OIDC authentication process. | ||
|
||
1. Fetch configuration from OIDC. GET to a non protected URL, such as | ||
https://preprod.bankidapis.no/oidc/oauth/.well-known/openid-configuration | ||
https://oidc-current.bankidapis.no/auth/realms/current/.well-known/openid-configuration | ||
The configuration contains information such as relevant endpoints, and public key for the id_token (JWT). | ||
|
||
2. Redirect to the authentication URL. | ||
|
||
3. Handle the callback from UIDC. The callback contains an attribute *access_code* which needs to be exchanged with the *access_token* (POST to OIDC) | ||
3. Handle the callback from OIDC. The callback contains an attribute *access_code* which needs to be exchanged with the *access_token* (POST to OIDC) | ||
|
||
4. Fetch user info. Finally we use the *access_token* to fetch a protected resource, in this case the user info provided by BID OIDC. | ||
|
||
## Build and run | ||
To be able to run the application you will need to edit the client_id and client_password in the source code. | ||
Contact BankID Norge ([email protected]) to retrieve the appropriate settings. | ||
To be able to run the application you will need to edit the client_id and client_secret in the Configuration.class. | ||
See https://confluence.bankidnorge.no/confluence/pdoidcl/release-notes/provisioning for details on how to receive this. | ||
|
||
|
||
``` | ||
class Configuration { | ||
/** | ||
* Client_id and password must be inseted here for the appliction to work. | ||
* <p> | ||
* Make contact with BankID Norge ([email protected]) to retrieve the information needed. | ||
* Client_id and secret must be inseted here for the appliction to work. | ||
* | ||
*/ | ||
public static final String CLIENT_ID = "<insert client_id>"; | ||
public static final String CLIENT_PWD = "<insert client password>"; | ||
public static final String CLIENT_SECRET = "<insert client password>"; | ||
} | ||
``` | ||
|
||
|
@@ -53,7 +58,7 @@ This example application uses the following libraries | |
|
||
**nimbus-jose-jwt** for handling the json web token | ||
|
||
**jetty-maven-plugin** for running the application locally | ||
**jetty-maven-plugin** for running the application locally with a dynamically created ssl-certificate. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,16 @@ | |
|
||
class Configuration { | ||
|
||
public static final String CONFIG_URL = "https://preprod.bankidapis.no/oidc/oauth/.well-known/openid-configuration"; | ||
public static final String CALLBACK_URL = "http://localhost:8080/callback"; | ||
public static final String CONFIG_URL = "https://oidc-current.bankidapis.no/auth/realms/current/.well-known/openid-configuration"; | ||
public static final String CALLBACK_URL = "https://localhost:8443/callback"; | ||
|
||
public static final String SCOPE = "openid"; | ||
public static final String SCOPE = "openid profile"; | ||
|
||
/** | ||
* Client_id and password must be inserted here for the application to work. | ||
* Client_id and secret must be inserted here for the application to work. | ||
* <p> | ||
* Make contact with BankID Norge ([email protected]) to retrieve the information needed. | ||
* See https://confluence.bankidnorge.no/confluence/pdoidcl/release-notes/provisioning for details on how to receive this. | ||
*/ | ||
public static final String CLIENT_ID = "<insert client_id>"; | ||
public static final String CLIENT_PWD = "<insert client password>"; | ||
public static final String CLIENT_SECRET = "<insert client password>"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters