AzureAD/microsoft-authentication-library-common-for-objc

Aquire Token with default resource (graph api)

kayvanhaverbeck opened this issue · 1 comments

I have the following code from the native android plugin and i need to replicate on iOS:

     ```
           final String defaultGraphResourceUrl = "https://graph.windows.net/6baa4eb1-xxxxx-7d36d";

           final AcquireTokenParameters.Builder builder = new AcquireTokenParameters.Builder();

            builder.startAuthorizationFromActivity(getActivity()).withCallback(getAuthInteractiveCallback());
            builder.withAuthorizationQueryStringParameters(null);
            builder.withResource(defaultGraphResourceUrl.trim());

            final AcquireTokenParameters parameters = builder.build();

What is the right way to add the withResource to:


[application acquireTokenWithParameters:interactiveParams completionBlock:^(MSALResult * _Nullable result, NSError * _Nullable error) {
if (!error) {
resolve([self MSALResultToDictionary:result withAuthority:authority]);
} else {
reject([[NSString alloc] initWithFormat:@"%d", (int)error.code], error.description, error);
}
}];

Hi @kayvanhaverbeck,

Thanks to your question. we only support resource in ADAL but not MSAL.

Instead we are using scope in MSAL. For more details, please check here