DeviceCodeInfo Class
- java.
lang. Object - com.
azure. identity. DeviceCodeInfo
- com.
public class DeviceCodeInfo
Device Code Info represents the response returned from the device code endpoint containing information necessary for device code flow. By default, the information in Device code info is printed onto the console as instructions for the user to follow when authenticating via DeviceCodeCredential. But, in the event user would like to override that behaviour and handle the device code info response, they can do so by specifying a challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer) when instantiating the device code credential.
Constructor Summary
Constructor | Description |
---|---|
DeviceCodeInfo(String userCode, String deviceCode, String verificationUrl, OffsetDateTime expiresOn, String message) |
Creates an instance of a device code info. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getDeviceCode()
Gets the code which should be included in the request for the access token. |
Offset |
getExpiresOn()
Gets the expiration time of device code. |
String |
getMessage()
Gets the message which should be displayed to the user. |
String |
getUserCode()
Gets the code which user needs to provide when authenticating at the verification URL. |
String |
getVerificationUrl()
Gets the URL where user can authenticate. |
Methods inherited from java.lang.Object
Constructor Details
DeviceCodeInfo
public DeviceCodeInfo(String userCode, String deviceCode, String verificationUrl, OffsetDateTime expiresOn, String message)
Creates an instance of a device code info.
Parameters:
Method Details
getDeviceCode
public String getDeviceCode()
Gets the code which should be included in the request for the access token.
Returns:
getExpiresOn
public OffsetDateTime getExpiresOn()
Gets the expiration time of device code.
Returns:
getMessage
public String getMessage()
Gets the message which should be displayed to the user.
Returns:
getUserCode
public String getUserCode()
Gets the code which user needs to provide when authenticating at the verification URL.
Returns:
getVerificationUrl
public String getVerificationUrl()
Gets the URL where user can authenticate.
Returns:
Applies to
Azure SDK for Java