共用方式為


AuthenticationRecord Class

  • java.lang.Object
    • com.azure.identity.AuthenticationRecord

public final class AuthenticationRecord

Authentication Record represents the account information of the authenticated account. This is helpful in scenarios where applications require brokered authentication via DeviceCodeCredential or InteractiveBrowserCredential.

Authentication record is returned when authenticate() or authenticate() api is invoked. The returned auth record can be stored/persisted in the user application. Further, this record can be configured on the authenticationRecord(AuthenticationRecord authenticationRecord) or authenticationRecord(AuthenticationRecord authenticationRecord) to proactively indicate that a previously authenticated account should be used from the persisted cache instead of authenticating again.

Method Summary

Modifier and Type Method and Description
static AuthenticationRecord deserialize(InputStream inputStream)

Deserializes the AuthenticationRecord from the specified InputStream

static Mono<AuthenticationRecord> deserializeAsync(InputStream inputStream)

Deserializes the AuthenticationRecord from the specified InputStream

String getAuthority()

Get the authority host used to authenticate the account.

String getClientId()

Get the client id of the application used for authentication.

String getHomeAccountId()

Get the unique identifier of the account.

String getTenantId()

Get the tenant, which the account authenticated in.

String getUsername()

Get the user principal name of the account.

void serialize(OutputStream outputStream)

Serializes the AuthenticationRecord to the specified OutputStream

Mono<OutputStream> serializeAsync(OutputStream outputStream)

Serializes the AuthenticationRecord to the specified OutputStream

Methods inherited from java.lang.Object

Method Details

deserialize

public static AuthenticationRecord deserialize(InputStream inputStream)

Deserializes the AuthenticationRecord from the specified InputStream

Parameters:

inputStream - The InputStream from which the serialized record will be read.

Returns:

deserializeAsync

public static Mono deserializeAsync(InputStream inputStream)

Deserializes the AuthenticationRecord from the specified InputStream

Parameters:

inputStream - The InputStream from which the serialized record will be read.

Returns:

A Mono containing the AuthenticationRecord object.

getAuthority

public String getAuthority()

Get the authority host used to authenticate the account.

Returns:

the authority host.

getClientId

public String getClientId()

Get the client id of the application used for authentication.

Returns:

the client id.

getHomeAccountId

public String getHomeAccountId()

Get the unique identifier of the account.

Returns:

the account id.

getTenantId

public String getTenantId()

Get the tenant, which the account authenticated in.

Returns:

the tenant id.

getUsername

public String getUsername()

Get the user principal name of the account.

Returns:

the username.

serialize

public void serialize(OutputStream outputStream)

Serializes the AuthenticationRecord to the specified OutputStream

Parameters:

outputStream - The OutputStream to which the serialized record will be written to.

serializeAsync

public Mono serializeAsync(OutputStream outputStream)

Serializes the AuthenticationRecord to the specified OutputStream

Parameters:

outputStream - The OutputStream to which the serialized record will be written to.

Returns:

A Mono containing Void

Applies to