How to get id token from IdP - cniackz/public GitHub Wiki

Objective:

To get id_token from IdP

Diagram:

telegram-cloud-photo-size-1-5118537003565165691-y

Links:

Pre-requisites:

  • You should have IdP configured

Steps:

  1. In an incognito window of chrome browser get:

https://dev-xqm5ioqlmy7qyjvl.us.auth0.com/authorize?audience=https://dev-xqm5ioqlmy7qyjvl.us.auth0.com/api/v2/&scope=openid&response_type=code&client_id=rMVc40T7fwgbEez1svp8wmjBtSaoKIOJ&redirect_uri=http://localhost:5005/oauth_callback

  1. From the URL above get the code:
http://localhost:5005/oauth_callback?code=4bcuTPrXa3k9s6YvGvbKRyh4Myfg7Z1ZIPxASZHijrKV1

code=4bcuTPrXa3k9s6YvGvbKRyh4Myfg7Z1ZIPxASZHijrKV1

  1. In Postman POST and get the id_token:
{"client_id":"rMVc40T7fwgbEez1svp8wmjBtSaoKIOJ","client_secret":"SlQcQAUdUjW8ZPbp5qdbQYM5P7Pkp4GtGeXKky_dThl8Uk2NWdGu13dO9ftN0umH","grant_type":"authorization_code","code":"dq-sIRiumd6mvzQz3wdy60R9qvfH1H4xV1rrnx_ER2Qvm","redirect_uri":"http://localhost:5005/oauth_callback"}

Explanation:

  • client_secret comes from the Application as well, and you can get it from within the app as observed below:
  • redirect_uri documentation can found at https://auth0.com/docs/api/authentication?http#database-ad-ldap-passive- it says as below, I configured callback url but after user logins in my case it fails, so I bet I need to do more job to investigate how this actually works, but I did not because in that process I got the code and the code is all i needed for getting the id_token so for next time:
The URL to which Auth0 will redirect the browser after authorization has been granted by the user. Specify the redirect_uri under your [Application's Settings](https://manage.auth0.com/?_gl=1*1e8r7xw*_gcl_aw*R0NMLjE3MTc2ODY3MjYuQ2p3S0NBand2SVd6QmhBbEVpd0FISFdndmNpY09KQlk5M1NjV2hpZi1lQnhZTWNRU0JjSGFFSXJLbDFZb25xa2QxR1czRDVyVWVQbkZob0NDTzhRQXZEX0J3RQ..*_gcl_au*MTMwMDEzOTA0My4xNzE3NTMwMTM4*_ga*MTUxNTczNDgxNi4xNzE3NTMwMTM5*_ga_QKMSDV5369*MTcxNzY4NjcyNS42LjEuMTcxNzY4NzM2My41MC4wLjA.#/applications).
  • "grant_type":"authorization_code": grant_type, Denotes the flow you are using. For Authorization Code, use authorization_code.
  • code: The Authorization Code received from the initial /authorize call.