-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add access_token property to UserInformation #393
Comments
Hi @fileman, thanks for commenting! Could you share more details about your scenario please? |
Hi, to rephrase you want UserInformation to have the AccessToken property being available? As for refresh token, it is already handled, if you call SignInAsync again (after a successful first time), the second time it will be a silent sign-in. |
Yes, so I can use it when I have to invoke bearer protected web api, azure functions, odata endpoint, etc... something like I do now with azure mobile apps. |
Thanks @fileman, I've added this feature request to our backlog. Others - feel free to give a thumbs up if this is a feature you'd like to see. |
Hey @fileman! Just wanted to let you know that we’re created a feature to return and expose the access token (JWT) to users in the signIn() method, and will be working on it shortly. Will update again when it’s live. |
I also need the ability to retrieve the JWT if the user is already signed in or can be signed in silently. Ideally a call to SignIn with a (bool silent=True) parameter - this can then be called when the UI is being rendered - to display a 'Login' or 'Logout' button as appropriate. |
Hi @futie, thanks for the feedback, and got it on your feature request to return whether the user is signed in is true. We have a feature that will be worked on soon to return the JWT in the signIn() method, so you can check if the JWT is null or not. If it's null, it means that the user has not signed in; else the user has signed in. The workaround you can do now is to store the For both @futie and @fileman, we're always looking for feedback to improve Auth, would you be available to hop on a call with me to learn more about your experience? Email me at amchew [at] microsoft [dot] com. |
> As for refresh token, it is already handled, if you call SignInAsync again (after a successful first time), the second time it will be a silent sign-in. Just in relation to the above, yes, my experience is that it will pass straight through but if you have more than one identity provider enabled, the user will be presented with the provider selection screen and then once selected and if previously authenticated, it will silently pass through. It would be nice to have a refresh token for the last successful login with the relevant provider so we can pass that straight through without even prompting the user to open the b2c webview login control. Maybe I'm missing something but that's been my experience and a more seamless one would be really handy. Apologies if this enhancement is being handled as a part of a future release already but I just wanted to get my 2 cents in. I also concur re: the bearer token, to have that would be absolute gold. Specifically for Azure AD in a corporate sense, to be able to use that token (if possible) to other O365 and Azure based services would be extremely beneficial. Again, I hope I'm not speaking out of turn. |
Hey @brad302, in our next release of the SDK (sometime in the third week of Jun - will keep y'all updated!), we will be exposing the access token and id token. You should be able to determine based on the token whether to show the user the login UI or not. For example,
Would that work for your scenario? Not sure if you really need the refresh token for this scenario. Let us know if you do, and what you're using it for. Never apologize. We really appreciate all the feedback! 👯♂ |
Hi @fileman, @futie, @brad302 (and @landrzz, @sdg85)! An update: we completed the work to expose the access and id token today and this will be released in the next version of our SDK - before the end of June. We'll be sharing in our documentation how to parse the access and id token, what actions to take if the user is signed in or not. Also, with today's current feature set, you can determine if the user is signed in or not by calling |
@amchew you guys rock, massive thanks! I'll keep an eye out for it and feedback where appropriate. |
@amchew is there appcenter nightly/myget CI build? |
Hey @fileman, @futie, @brad302, @landrzz, @sdg85, @masatoru, @damienaicheh, you can now get the access and id tokens for Auth in the 2.1.0 Android, iOS SDK and 2.1.1 Xamarin SDK releases! Here are the repos and documentation for the following platforms:- Xamarin iOS For iOS Cocoapods users, you need to bump version of Podfile and run Android You can upgrade the versions via Visual Studio or Android Studio (bump version or follow the warning in Gradle). Try it out, and let us know what you think! :) |
@amchew is exactly what I need! |
Hey Guys, I am using the latest stable version of Auth 2.6.1 on both Xamarin Android & iOS head projects as well is in my .Net Standard project (mine is a Xamarin Forms solution) I am calling SignInAsync every single time the app starts. Here is what I observe: On iOS: First run shows login window & when correct credentials are added, it authenticates successfully. However. it keeps showing the login window on every subsequent calls as well. Am I missing something? Should I not call SignInAsync every single time & make it conditional based on certain conditions? If yes, what conditions? Your help on this is really appreciated. Thanks |
Describe the solution you'd like
Since MSAL is used under the cover, if AuthenticationResult has access_token value add to new property in UserInformation.
Describe alternatives you've considered
Continue to use MSAL to AzureAD B2C
Additional context
even AcquireTokenSilent with refresh_token... if not handled inside the SignInAsync method
The text was updated successfully, but these errors were encountered: