Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use /oauth/token since version 2.0.0 #345

Closed
LieneJansone opened this issue Sep 2, 2022 · 1 comment
Closed

Unable to use /oauth/token since version 2.0.0 #345

LieneJansone opened this issue Sep 2, 2022 · 1 comment

Comments

@LieneJansone
Copy link

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:

  1. Not passing Context-Type header => returns 415 error 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)
  1. Passing Context-Type: application/json header => returns 400 error 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? :)

@Tamara-Barum
Copy link

Closing as this was fixed in PR 346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants