Himanshu Garg
Himanshu Garg

Reputation: 75

How to get the idToken from Microsoft using react-native-azure-ad-2 in react native?

I am building mobile application in React Native. Where I have to login with Azure AD using React-native-azure-ad-2 package. I have registered my application on Azure AD in App Registration by selecting Public client (mobile & desktop) option.

I am facing below issues:

1) What should I write in Redirect URI while app registration?

2) How do i get the idToken (JWT)? it is giving only access token.

Below is the response which I get from the SDK.

{token_type: "Bearer", scope: "https://graph.microsoft.com/User.Read https://graph.microsoft.com/Mail.Read", expires_in: 3600, ext_expires_in: 3600, access_token: "EwBgA8l6BAAURSN/FHlDW5xN74t6GzbtsBBeBUYAAYc2qpTiRI…1K8vK7jE80AZ6mgzpziYLWeJsFrJHnJ8vJN8nxIerszo5PoQC"}

But i need the idToken in JWT format.

Upvotes: 2

Views: 739

Answers (1)

Tony Ju
Tony Ju

Reputation: 15629

1) What should I write in Redirect URI while app registration?

It does't matter, it is the URI to which Microsoft Azure AD will redirect in response to an OAuth 2.0 request. The value does not need to be a physical endpoint, but must be a valid URI.

enter image description here

2) How do i get the idToken (JWT)?

Add openid to the scope.

enter image description here

Upvotes: 2

Related Questions