https://github.com/athiththan11/token-cache-revoke-handler
Token Cache Revoke Handler for WSO2 API Manager
https://github.com/athiththan11/token-cache-revoke-handler
handler revoke token-cache wso2 wso2-api-manager
Last synced: 11 months ago
JSON representation
Token Cache Revoke Handler for WSO2 API Manager
- Host: GitHub
- URL: https://github.com/athiththan11/token-cache-revoke-handler
- Owner: athiththan11
- License: apache-2.0
- Created: 2021-03-28T09:55:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-03T12:58:58.000Z (about 5 years ago)
- Last Synced: 2025-06-02T11:21:23.142Z (about 1 year ago)
- Topics: handler, revoke, token-cache, wso2, wso2-api-manager
- Language: Java
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Token Cache Revoke Handler - WSO2 API Manager v2.6
Sample handler implementation to revoke the token caches of Gateway component in WSO2 API Manager v2.6.0 using Event-based architecture.
> This handler is designed for WSO2 API Manager v2.6.0 (+1612313472144). The handler needs to be engaged and used with the API Manager v2.6.0 with the latest or after WUM timestamp 1612313472144 to work as expected.
## How it works?
The provided sample handler will be engaged with `_RevokeAPI_.xml` to revoke the token caches in the Gateway component.
Once receiving a response from the Revoke endpoint, the handler collects the Revoked token metadata and publishes an event to the configured Traffic Manager component. Whereas the Traffic Manager re-routes the received event and publishes it to all subscribed Gateway components to clear the token caches.
## Build & Deploy
### Build
Execute the following maven command to build and create a bundle JAR artifact
```sh
mvn clean package
```
### Deploy
Copy and place the built JAR artifact from `/target` directory to `/repository/components/dropins` directory in API Manager server. Once deployed, restart the server to load the artifacts.
Add the following Handler definition and configure the `/repository/deployment/server/synapse-configs/defualt/api/_RevokeAPI_.xml` as following in the Gateway node to engage the built custom handler
```xml
...
...
```
### Configure API Manager (Gateway)
Configure the Gateway node to publish the data events to the Traffic Manager node as following
> Note: The same following configurations are used to evaluate the Throttling conditions in the API Manager server. Hence, it is not required to re-configure the same if they have been already enabled and configured to publish the events to the respective Traffic Manager nodes
```xml
...
true
Binary
tcp://traffic-manager:9611
ssl://traffic-manager:9711
traffic-manager-username
traffic-manager-password
true
...
true
throttleData
...
amqp://traffic-manager-username:traffic-manager-password@clientid/carbon?brokerlist='tcp://traffic-manager:5672'
...
...
```
## License
[Apache 2.0](LICENSE)