1
votes

I have registered an app in the Azure AD portal and given Microsoft Graph API permissions to fetch user data (user.read.) and yammer feeds.

Note: the app is also registered with the yammer portal.

App auth is working fine if I have used a single scope but it fails in case of multiple scopes.

cases :

Working fine in single scope case val SCOPES = arrayOf("https://graph.microsoft.com/.default")

Not Working in multiple scope case val SCOPES = arrayOf("https://graph.microsoft.com/.default", "https://api.yammer.com/user_impersonation")

We are using Graph SDK in Android.

Thanks in Advance.

please suggest a way to achieve the solution.

1
Can you describe the error? Are you using the Java SDK or the Android SDK? The Java SDK is intended as a replacement for the older Android SDK.Darrel Miller
@DarrelMiller Yammer doesn't officially support AAD tokens and the O365 Developer Platform, so it's best that devs follow the supported authentication flows (developer.yammer.com/docs/oauth-2) until this is eventually supported.Brian Lyttle

1 Answers

2
votes

You have set two scopes from different resources, which is not supported.

Because, finally you will get an Azure AD access token. However, the aud claim in the token can only represents one resource.

enter image description here


Conclusion:

  1. You can add more than one scopes from one resource. For example: https://graph.microsoft.com/User.Read.All, https://graph.microsoft.com/Mail.ReadWrite and other scopes from Microsoft Graph.

  2. If you want to get token for more than one resource, you need to get tokens for them separately.