*******************************************************************
* Authorization Code Flow Sample
*
*******************************************************************

This sample demonstrates the steps involved in obtaining the Access token using the Authorization code flow. 
- It obtains the authorization code
- Exchanges the authorization code for the Access token
- Uses the Access token to invoke an endpoint to retrieve user name and other token details.
 

Steps to run this application
===================================================================
1. Ensure that Access Manager is configured for Authorization code flow by executing the Try Now bundle.
   - Get the Identity server host and IP
   - Get the client ID and secret for the 'OauthDemoClient' autoconfigured by Try Now
2. Edit the application.yaml file. Update the following fields:
     ...
	  clientId: 643085f5-8c29-458e-9e25-36149a15ef2e
      clientSecret: GNaizwWYYFnCs2xM-6vLupx4FNIb9pbgEFjElps2RrpNTIbcFCvHj5LwRWzO1w41H9WP36T7G3ryO_vFY7mPyQ
      accessTokenUri: https://sb-test147.labs.blr.novell.com/nidp/oauth/nam/token
      userAuthorizationUri: https://sb-test147.labs.blr.novell.com/nidp/oauth/nam/authz
      tokenInfoUri: https://sb-test147.labs.blr.novell.com/nidp/oauth/nam/tokeninfo
    ...
      userInfoUri: https://sb-test147.labs.blr.novell.com/nidp/oauth/nam/userinfo
    ...
 
3. Run the application with the command: gradle bootrun
4. Access using http://localhost:8080/


Inner Workings of this application 
===================================================================
* Login 
* Provide the consent (asked just once when the user logs in for the first time)
* Access Manager redirects back to this application's /callback endpoint with the Authorization code
* AuthzCodeController.java gets the code. It will then:
  - exchange the authorization code for the access token.
  - use the access token to invoke the Token Info endpoint
  - return the token information
* Token info in JSON format will be displayed on the UI.


