I am currently working on Tyk Gateway CE. I’ve installed it using tyk-oss-k8s-deployment. Using OAuth 2.0 as reference:
-
I’ve created an API which should use OAuth for authentication:
{
“name”: “oauth-test-api”,
“slug”: “oauth-test-api”,
“api_id”: “oauth-test-api”,
“org_id”: “1”,
“use_oauth2”: true,
“oauth_meta”: {
“allowed_access_types”: [“client_credentials”],
“allowed_authorize_types”: [“token”],
“auth_login_redirect”: “http://httpbin.org/”
},
“definition”: {
“location”: “header”,
“key”: “x-api-version”
},
“version_data”: {
“not_versioned”: true,
“versions”: {
“Default”: {
“name”: “Default”,
“use_extended_paths”: true
}
}
},
“proxy”: {
“listen_path”: “/oauth-test-api/”,
“target_url”: “http://httpbin.org/”,
“strip_listen_path”: true
},
“active”: true
} -
I’ve created a persistent volume and persistent volume claim where I can update policies.json. Currently policies.json contains the following:
{
“oauth_test_policy”: {
“access_rights”: {
“oauth-test-api”: {
“allowed_urls”: [],
“api_id”: “oauth-test-api”,
“api_name”: “oauth-test-api”,
“versions”: [
“Default”
]
}
},
“active”: true,
“name”: “OAuth Test Policy”,
“rate”: 100,
“per”: 1,
“quota_max”: 10000,
“quota_renewal_rate”: 3600,
“tags”: [“Test Policy”]
}
} -
Then, I hit /oauth-test-api/oauth/token to retrieve the token
-
Once I got the token, I added it as bearer for my API call.
However, I’m receiving this error:
{
“error”: “Key not authorised”
}
Can you please tell me if I missed or misconfigured anything ?
Thanks in advance.