21.1 Custom Authentication
This topic describes how to configure custom authentication in Routing Hub.
Purpose
Currently, routing hub offers few different authentication options.
However, these options are not flexible enough to handle every authentication scenario.
To address this, we have introduced a new option: Custom Authentication.
How it works
User simply need to specify the token endpoint details in routing hub. This ensures that routing hub can seamlessly connect to and communicate with your authentication configuration.
How it is different from Chaining?
You can use Chaining, where the token endpoint transformation is created directly inside the consumer service, but it does not support token cache management. This means every request hits your token endpoint first, regardless of the token's expiry time.
Custom Authentication solves this problem by treating the token endpoint as a separate consumer service and performing token cache management. This prevents unnecessary token endpoint hits.
Steps for Maintenance
- Create an implementation specifically for Token Endpoint.
- Create consumer service for token integration and toggle ON the "Custom Authentication" flag.
- Create transformation and routing for token integration.
(Note: Response transformation template should be kept empty if token field is and expiry time field is ).
- Change the authentication type of implementation to Custom Auth and select the token integration’s consumer service in ConsumerService drop-down.
(Here, implementation will be referring the actual service endpoints/operations of provider)
Sample Configuration
Token_CS (Consumer Service) (Custom Authentication flag -> true)
Provider (Service Provider)
Auth_Impl (Implementation) (Authentication Type -> None/Basic)
FetchBalance_CS (Consumer Service)
Provider (Service Provider)
Bal_Impl (Implementation) (Authentication Type -> Custom Auth & Consumer Service -> Token_CS
How to maintain sensitive fields?
Environment variables need to be created for all the fields which are sensitive in nature. In environment variables, we have a “Sensitive” flag which will ensure that the values are not stored as plaintext in routing hub.
Parent topic: Configuration Scenarios