Package com.azure.communication.common
Class CommunicationTokenCredential
java.lang.Object
com.azure.communication.common.CommunicationTokenCredential
- All Implemented Interfaces:
AutoCloseable
Provide user credential for Communication service user
-
Constructor Summary
ConstructorDescriptionCommunicationTokenCredential
(CommunicationTokenRefreshOptions tokenRefreshOptions) Create with tokenRefreshOptions, which includes a token supplier and optional serialized JWT token.Create with serialized JWT token -
Method Summary
-
Constructor Details
-
CommunicationTokenCredential
Create with serialized JWT token- Parameters:
token
- serialized JWT token
-
CommunicationTokenCredential
Create with tokenRefreshOptions, which includes a token supplier and optional serialized JWT token. If refresh proactively is true, callback function tokenRefresher will be called ahead of the token expiry by the number of minutes specified by CallbackOffsetMinutes defaulted to ten minutes.- Parameters:
tokenRefreshOptions
- implementation to supply fresh token when reqested
-
-
Method Details
-
getToken
Get Azure core access token from credential- Returns:
- Asynchronous call to fetch actual token
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-