Class CommunicationTokenCredential

java.lang.Object
com.azure.communication.common.CommunicationTokenCredential
All Implemented Interfaces:
AutoCloseable

public final class CommunicationTokenCredential extends Object implements AutoCloseable
Provide user credential for Communication service user
  • Constructor Details

    • CommunicationTokenCredential

      public CommunicationTokenCredential(String token)
      Create with serialized JWT token
      Parameters:
      token - serialized JWT token
    • CommunicationTokenCredential

      public CommunicationTokenCredential(CommunicationTokenRefreshOptions tokenRefreshOptions)
      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

      public Mono<com.azure.core.credential.AccessToken> getToken()
      Get Azure core access token from credential
      Returns:
      Asynchronous call to fetch actual token
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException