public static interface IPublicClientApplication.DeviceCodeFlowCallback
onUserCodeReceived(String, String, String, Date).
2). Receiving a successful authentication result containing a fresh access token
via onTokenReceived(AuthenticationResult).
3). Receiving an exception detailing what went wrong in the protocol
via onError(MsalException).
Refer to IPublicClientApplication.acquireTokenWithDeviceCode(String[], DeviceCodeFlowCallback).
| Modifier and Type | Method and Description |
|---|---|
void |
onError(MsalException error)
Invoked if an error is encountered during the device code flow and passes the exception object.
|
void |
onTokenReceived(AuthenticationResult authResult)
Invoked once token is received and passes the
AuthenticationResult object. |
void |
onUserCodeReceived(java.lang.String vUri,
java.lang.String userCode,
java.lang.String message,
java.util.Date sessionExpirationDate)
Invoked to display verification uri, user code, and instruction message during device code flow.
|
void onUserCodeReceived(java.lang.String vUri,
java.lang.String userCode,
java.lang.String message,
java.util.Date sessionExpirationDate)
vUri - verification uriuserCode - user codemessage - instruction messagesessionExpirationDate - the expiration date of DCF session to be displayed to the user ONLY.
When the session expires, onError() will return an exception with DEVICE_CODE_FLOW_EXPIRED_TOKEN_ERROR_CODE.
Please rely on that exception for non-UX purposes.void onTokenReceived(AuthenticationResult authResult)
AuthenticationResult object.authResult - the authentication resultvoid onError(MsalException error)
error - error exception