简体   繁体   中英

How to get access token instead of pointing to redirect URL in Azure AD B2C

I've created a custom policy in my Azure AD B2C tenant from which I'm getting my user flow endpoint. At this point I am able to log my registered user in and after a successful login attempt it redirects me to my redirect URL (which in my case is https://jwt.ms ) where my access token is decoded.

What I'm doing right now is opening the same user flow endpoint in a react native app using WebView . It works perfectly but it then redirect to my redirect URL ( https://jwt.ms ) which I dont want. What I want is to return me the access token which I can get after a successful login so I can use the token to get the user information by decoding it.

How can I get access token instead of my app pointing to redirect URL?

I was digging for a solution and found this library. This library takes your existing AADB2C tenant and returns you the access token.

Note you might want to edit onNavigationStateChange function in LoginView.js to close the webview and redirect your app to a specific screen after login.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM