symphony-bdk-java icon indicating copy to clipboard operation
symphony-bdk-java copied to clipboard

Add extra enhanced auth token to all APIs requests

Open yinan-symphony opened this issue 1 year ago • 0 comments

Feature Request

The requested feature would be provide a way to inject an extra auth token to all API requests' header, along with a way to automatically refresh the token when it s expired.

Description of Problem:

Symphony APIs requires the session token and key manager token to authenticate the requests. in BDK, once the bot authenticates itself, the retrieved tokens are systematically added to all APIs requests.

However in case where all Symphony components are behind a gateway, Apigee for instance, there is no way to inject the extra auth token to all API requests, in order to authenticate the requests against Apigee, therefore requests are rejected.

Potential Solutions:

A new interface allowing bdk bot developer to retrieve the token, also determine the expiration of the token based on the exception.

     public interface CustomEnhancedAuthAuthenticator {
          
        /**
         * Authenticates.
         *
         * @return the authentication session.
         */
        @Nonnull
        String authenticate() throws AuthUnauthorizedException;
      
        boolean isAuthTokenExpired(ApiException exception);
     }

yinan-symphony avatar Feb 01 '24 16:02 yinan-symphony