Interface TibjmsOAuth2TokenFetchCallback


  • public interface TibjmsOAuth2TokenFetchCallback
    Set a callback that will be invoked whenever a connection needs to acquire an OAuth 2.0 access token.

    To use OAuth 2.0 access tokens obtained via an external mechanism, the client application can provide a callback that will be invoked by connection objects whenever an access token is required. This can be done by implementing this interface in your client application and registering an instance of the new class with a connection factory using the Tibjms.PROP_OAUTH2_TOKEN_FETCH_CALLBACK_OBJECT ConnectionFactory property. Connections created using that particular factory will invoke the registered object's onOAuth2TokenFetchRequest method whenever they require an access token for authentication with the EMS server.

    • Method Detail

      • onOAuth2TokenFetchRequest

        java.lang.String onOAuth2TokenFetchRequest​(Connection connection)
        This method is invoked by a connection to obtain an access token for initial authentication or re-authentication with the server. Once the callback method returns with an OAuth 2.0 access token, the connection will use it to either perform the initial authentication with the server, or send it as part of the next message in order to re-authenticate with the server. If the server fails to validate the token then it disconnects the client.
        Parameters:
        connection - The connection that invoked this method.
        Returns:
        An OAuth 2.0 access token.
        Since:
        EMS 10.3.0