package
0.0.0-20241108211809-e417158c4f9d
Repository: https://github.com/tyktechnologies/custom-plugins.git
Documentation: pkg.go.dev

# README

Upstream Oauth2.0 Plugin for Tyk Gateway

This plugin allows the Tyk Gateway to undergo a client_credentials flow for OAuth2.0 to obtain a JWT. This subsequent JWT can be utilized for Authorizing access to APIs.

Configuration

Configuration is via environment variables.

TYK_CUSTOM_OAUTH_CLIENT_ID=YOUR_APPLICATION_CLIENT_ID
TYK_CUSTOM_OAUTH_CLIENT_SECRET=YOUR_APPLICATION_CLIENT_SECRET
TYK_CUSTOM_OAUTH_TOKEN_ENDPOINT=YOUR_APPLICATION_TOKEN_ENDPOINT

Usage

Assuming you have an upstream that's protected by OAuth, this plugin will allow you to access that resource. Subsequently the returned Access Token will be cached in the Redis that is installed alongside Tyk-Gateway. You can layer on any Tyk native Authorization on-top of this plugin.

# Functions

UpstreamOAuth Execute at Post Auth Middleware stage (assume initial JWT validation at this point) Leverage ClientID & Secret that's from environment variables as a cacheKey IF cacheKey exists && not expired, leverage it for a subsequent call to upstream (overwrite header) ELSE make a post request to obtain a new JWT, update the cache key in Redis */.

# Structs

No description provided by the author
No description provided by the author