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
DeviceCodeCredential.authenticate()
or InteractiveBrowserCredential.authenticate()
api is invoked.
The returned auth record can be stored/persisted in the user application. Further, this record can be configured on
the DeviceCodeCredentialBuilder.authenticationRecord(AuthenticationRecord)
or
InteractiveBrowserCredentialBuilder.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 TypeMethodDescriptionstatic AuthenticationRecord
deserialize
(InputStream inputStream) Deserializes theAuthenticationRecord
from the specifiedInputStream
static Mono<AuthenticationRecord>
deserializeAsync
(InputStream inputStream) Deserializes theAuthenticationRecord
from the specifiedInputStream
Get the authority host used to authenticate the account.Get the client id of the application used for authentication.Get the unique identifier of the account.Get the tenant, which the account authenticated in.Get the user principal name of the account.void
serialize
(OutputStream outputStream) Serializes theAuthenticationRecord
to the specifiedOutputStream
serializeAsync
(OutputStream outputStream) Serializes theAuthenticationRecord
to the specifiedOutputStream
-
Method Details
-
getAuthority
Get the authority host used to authenticate the account.- Returns:
- the authority host.
-
getHomeAccountId
Get the unique identifier of the account.- Returns:
- the account id.
-
getTenantId
Get the tenant, which the account authenticated in.- Returns:
- the tenant id.
-
getClientId
Get the client id of the application used for authentication.- Returns:
- the client id.
-
getUsername
Get the user principal name of the account.- Returns:
- the username.
-
serializeAsync
Serializes theAuthenticationRecord
to the specifiedOutputStream
- Parameters:
outputStream
- TheOutputStream
to which the serialized record will be written to.- Returns:
- A
Mono
containingVoid
-
serialize
Serializes theAuthenticationRecord
to the specifiedOutputStream
- Parameters:
outputStream
- TheOutputStream
to which the serialized record will be written to.
-
deserializeAsync
Deserializes theAuthenticationRecord
from the specifiedInputStream
- Parameters:
inputStream
- TheInputStream
from which the serialized record will be read.- Returns:
- A
Mono
containing theAuthenticationRecord
object.
-
deserialize
Deserializes theAuthenticationRecord
from the specifiedInputStream
- Parameters:
inputStream
- TheInputStream
from which the serialized record will be read.- Returns:
- the
AuthenticationRecord
object.
-