Here’s a step by step guide with Python writing an auth plugin:
https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/custom-auth-python-tutorial/
You could then combine this with the ID extractor, just add this to the custom moddleware section of the manifest and replace the header name:
"id_extractor": {
"extract_from": "header",
"extract_with": "value",
"extractor_config": {
"header_name": "Authorization"
}
},
This will then attempt to cache the header value so that we don’t need to run the middleware over and over.