Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Support for aquire token silently? #12

Open
ricsantos opened this issue Sep 8, 2019 · 3 comments
Open

Support for aquire token silently? #12

ricsantos opened this issue Sep 8, 2019 · 3 comments
Labels
enhancement New feature or request promote

Comments

@ricsantos
Copy link

ricsantos commented Sep 8, 2019

Hi, I am using the MSALAuthenticationProvider to authenticate my user, and after authentication I am able to successfully fetch the MSGraphBaseURL /me object. However, for each subsequent run of the request, the user is prompted via an alert and then a modal web view to Sign In again (although the sign in process is just tapping 'Continue').
Reading a quickstart guide on portal.azure.com, it advises to first acquire a token using applicationContext.acquireToken(with: parameters), and if a user has already signed in to request a token silently using applicationContext.acquireTokenSilent(with: parameters).
My questions:

Does this library support acquiring the token silently?
Does a token need to be acquired every app launch, or is it somewhat long lived?

Thanks
AB#6088

@ghost ghost added the ToTriage label Sep 8, 2019
@ricsantos
Copy link
Author

I've also noticed that this library https://github.com/AzureAD/microsoft-authentication-library-for-objc describes how to acquire the token silently.

@ricsantos
Copy link
Author

Update: following the guide on https://github.com/AzureAD/microsoft-authentication-library-for-objc I added the following items:

  • keychain access group
  • LSApplicationQueriesSchemes
  • application:open:url callback

Not sure if all 3 are required, but the requests now return without needing to sign in again 🎉

@MIchaelMainer MIchaelMainer added the enhancement New feature or request label Sep 17, 2019
@MIchaelMainer
Copy link
Contributor

Hello @ricsantos

Thank you for reporting this. Storing the credentials in the keychain would be a welcome addition to this library. Adding this to our backlog.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request promote
Projects
None yet
Development

No branches or pull requests

3 participants