Поделиться через


AuthenticationRequestCallback.getToken method

Gets the token. This method is invoked by the SDK whenever an authentication is required to complete an operation. The app developer will be given the authentication parameters that can be used to acquire the access token via a separate authentication library.

We recommend that you use the Azure AD Authentication Library (ADAL). However, other authentication libraries that support OAuth 2.0 can be used as well. For more information, see the Prerequisites section in the Android Apps topic under Get started.

Signature

public void getToken(Map<String, String> authenticationParameters,
                         AuthenticationCompletionCallback authenticationCompletionCallback);

Parameters

Name Datatype Notes
authenticationParameters
Map<String, String>
the authentication parameters as key value pairs.
{
  ("oauth2.authority", "https://login.windows.net/common/oauth2/token"), 
  ("oauth2.resource", "api.aadrm.com"),
  ("oauth2.scope" : "the scope"), 
  ("userId" : "the user Id")
}
authenticationCompletionCallback
[AuthenticationCompletionCallback](authenticationcompletioncallback-interface-java.md)
the completion block to put the async result

Defined in

AuthenticaionRequestCallback.java

Supported Platforms

Minimum supported OS version
Android 4.0.3 (API level 15)