ConnectedDevicesAccessTokenRequest Class

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.ConnectedDevicesAccessTokenRequest

public class ConnectedDevicesAccessTokenRequest

Request for an access token for the contained ConnectedDevicesAccount which satisfies the contained scopes. This request needs to completed by calling either completeWithAccessToken(@NonNull final String token) or completeWithErrorMessage(@NonNull final String error).

Method Summary

Modifier and Type Method and Description
void completeWithAccessToken(@NonNull final String token)

If a token with the requested scopes was successfully generated, call this method with the token to complete the request.

void completeWithErrorMessage(@NonNull final String error)

If a token with the requested scopes was not successfully generated for any reason, call this method with a message to be used for logging.

ConnectedDevicesAccount getAccount()

Gets the Account associated with this ConnectedDevicesAccessTokenRequest.

List<String> getScopes()

Get the list of scopes for which the token must cover when generated.

Method Details

completeWithAccessToken

public void completeWithAccessToken(@NonNull final String token)

If a token with the requested scopes was successfully generated, call this method with the token to complete the request.

Parameters:

token - Successfully generated token

completeWithErrorMessage

public void completeWithErrorMessage(@NonNull final String error)

If a token with the requested scopes was not successfully generated for any reason, call this method with a message to be used for logging.

Parameters:

error - A message describing why the token was unsuccessful.

getAccount

public ConnectedDevicesAccount getAccount()

Gets the Account associated with this ConnectedDevicesAccessTokenRequest.

Returns:

getScopes

public List getScopes()

Get the list of scopes for which the token must cover when generated.

Returns:

List of scopes in the format of strings

Applies to