AzureAD / microsoft-authentication-library-for-android

Microsoft Authentication Library (MSAL) for Android
http://aka.ms/aadv2
MIT License
214 stars 124 forks source link

How to set the corresponding scope for Android mailbox reading and sending #1808

Closed gnmmdk closed 1 year ago

gnmmdk commented 1 year ago

Our company has developed an app that uses mailcore2 to set oauth2 to obtain tokens and then connect. Now I have set the values for the scope as follows:

private val mScopes = listOf(

"User.Read",

"Mail.Read",

"Mail.ReadWrite",

"Mail.Send"

)

Alternatively:

private val mScopes = listOf(

"User.Read",

"IMAP.AccessAsUser.All",

)

This way, access can be obtained Toekn, but access obtained There seems to be a problem with the token, and it cannot be connected using mailcore2.

The following is the scope I configured in the Azure backend: image

negoe commented 1 year ago

@gnmmdk Can you provide more details about the problem with the token? What error message are you seeing when trying to connect using mailcore2? Have you checked if the token is still valid? Tokens usually have an expiration date, and if the token has expired, you won't be able to use it to connect.

negoe commented 1 year ago

Closing due to no response. Please feel free to reopen it.