agent
agent copied to clipboard
Unable to use /oauth/token since version 2.0.0
There is an issue with authentification using Issuer & Validator scheme since version 2.0.0
Issue description:
oauth/token endpoint is expecting Content-Type: application/json here, but auth service is expecting Content-Type: application/x-www-form-urlencoded here
To reproduce:
- Not passing
Context-Typeheader => returns415error code
#!/usr/bin/python3
import json
import requests
import sys
s = requests.Session()
s.headers.update({'X-Optimizely-SDK-Key': "mySDKkey"})
resp = s.post('http://localhost:8080/oauth/token', data={
"grant_type": "client_credentials",
"client_id": "myclientID",
"client_secret": "myclientSecret",
})
print(resp)
- Passing
Context-Type: application/jsonheader => returns400error code
#!/usr/bin/python3
import json
import requests
import sys
s = requests.Session()
s.headers.update({'X-Optimizely-SDK-Key': "mySDKkey"})
s.headers.update({'Content-Type': 'application/json'})
resp = s.post('http://localhost:8080/oauth/token', data={
"grant_type": "client_credentials",
"client_id": "myclientID",
"client_secret": "myclientSecret",
})
print(resp)
We are using a custom build image with a workaround of removing contentTypeMiddleware from here
Could this be looked into please? :)