Getting Token from UAA
Now that we have created a Client as well as user. Its time for the client to get the token for a logged in user.
Remember we are still using implicit Grant flow.
Steps
Testing The flow
- Go to
https://<UAA_INSTANCE_ID>.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/authorize?response_type=token&client_id=<CLIENT_ID>
and give the test user credentials that were created before.
For example: Check the screenshot.
Any request to UAA Server /oauth/authorize
endpoint resulted in a 302 Status Code with the location Header set to https://todo-client.run.aws-usw02-pr.ice.predix.io
with the parameters access_token
, token_type
, expires_in
,scope
& jti
PS : I already had a session with UAA. Hence got redirect in singleshot
Explanation
- We Just asked UAA instance to give us a token (check the request paramter
response_type
) - We Provided the
client_id
as well - Since we had given the callback URL before while creating the client, The browser gets a redirect to the callback URL with a token
Additional Configuration done on the client side.
- Enabled HTML5 Mode in nginx. Click here for Code Change.
- This way when the UAA redirects to
/callback
,index.html
page is returned and the we don't get a404
Error page
- This way when the UAA redirects to