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

wrong scopes #20

Open
zenmash opened this issue Dec 28, 2018 · 1 comment
Open

wrong scopes #20

zenmash opened this issue Dec 28, 2018 · 1 comment

Comments

@zenmash
Copy link

zenmash commented Dec 28, 2018

Wrong scopes after run the curl script:
curl -X POST
--url http://127.0.0.1:8001/services/mock-service/plugins/
--data "name=oauth2"
--data "config.scopes=email, phone, address"
--data "config.mandatory_scope=true"
--data "config.enable_authorization_code=true"

Following is the output:
{"created_at":1545989589,"config":{"refresh_token_ttl":1209600,"enable_client_credentials":false,"mandatory_scope":true,"provision_key":"TcHMQJvT7Iyk2tPlFYuqbJkUlHEYVW1a","accept_http_if_already_terminated":false,"hide_credentials":false,"enable_implicit_grant":false,"global_credentials":false,"enable_authorization_code":true,"enable_password_grant":false,"scopes":["email, phone, address"],"anonymous":null,"token_expiration":7200,"auth_header_name":"authorization"},"id":"a66aba0d-070c-4256-ae09-f2988b61ae9f","service":{"id":"9e6c0e17-70c8-4f9b-9604-7bbce191cb22"},"enabled":true,"run_on":"first","consumer":null,"route":null,"name":"oauth2"}

The correct "scopes" should be "scopes": [
"email",
"phone",
"address"
], not ["email, phone, address"].

It seems something wrong with the OAuth 2.0 plugins.
The version of kong is 1.0.0

@zenmash zenmash changed the title scopes is not error wrong scopes Dec 28, 2018
@capcom923
Copy link

Yes, I got the same error. At least, the scopes format below

--data "config.scopes=email, phone, address"

is not compatible with kong 1.2.1.

And based on the the doc of kong 1.2.1 "https://docs.konghq.com/hub/kong-inc/oauth2/"

the scopes can be also initiated as
--data "config.scopes=email"
--data "config.scopes=phone"
--data "config.scopes=address" \

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