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

[oauth2] Wrong redirect_uri cases that generate wrong behaviors #1267

Closed
codebien opened this issue May 30, 2016 · 1 comment
Closed

[oauth2] Wrong redirect_uri cases that generate wrong behaviors #1267

codebien opened this issue May 30, 2016 · 1 comment

Comments

@codebien
Copy link

Kong 0.8.2

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"right","redirect_uri": ["http://localhost"]}'

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"object","redirect_uri": {}}'

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"empty-array","redirect_uri": []}'

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"not-empty-string","redirect_uri": "http://localhost"}'

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"empty-string","redirect_uri": ""}'

curl -X POST --url http://kong:8001/consumers/Jason/oauth2
-H "Content-Type: application/json"
-d '{"name":"nullable","redirect_uri": null}'

curl http://kong:8001/consumers/Jason/oauth2
{
"data": [
{
"client_id": "18634b8fca6b48e8b571202e5e40e0de",
"client_secret": "1d06492334fe4d38aba70705f4f333db",
"consumer_id": "b620758d-5ae7-46cd-93bb-01991e8ef234",
"created_at": 1464628795000,
"id": "89b412ff-a1ba-48ba-b1a3-0bd186fa43c4",
"name": "empty-array",
"redirect_uri": {}
},
{
"client_id": "2563063c20f3439980cb7f5f8a46fc2a",
"client_secret": "25204f81c6974683b0735e2e7a29bceb",
"consumer_id": "b620758d-5ae7-46cd-93bb-01991e8ef234",
"created_at": 1464628796000,
"id": "a3dad252-6da2-4b2c-b80a-a10a22355574",
"name": "not-empty-string",
"redirect_uri": [
"http://localhost"
]
},
{
"client_id": "dd615b80f0b54d41a9cfd19a0e6ce701",
"client_secret": "9abfd09e0964461b804274b6d00e6d87",
"consumer_id": "b620758d-5ae7-46cd-93bb-01991e8ef234",
"created_at": 1464628795000,
"id": "0d26a7b8-cc45-4725-9897-4ad2fa407c5d",
"name": "right",
"redirect_uri": [
"http://localhost"
]
},
{
"client_id": "dd4f431fa88c413783329fcabaa203fe",
"client_secret": "393120d4ddf84728a29ee75c880ff901",
"consumer_id": "b620758d-5ae7-46cd-93bb-01991e8ef234",
"created_at": 1464628795000,
"id": "679d6189-9ae2-4f59-a5e5-f9b300968761",
"name": "object",
"redirect_uri": {}
},
{
"client_id": "44f5b10de0634f1daf93526227c7998f",
"client_secret": "78127f7a6dbe4340ba24cb32f2946aa4",
"consumer_id": "b620758d-5ae7-46cd-93bb-01991e8ef234",
"created_at": 1464628796000,
"id": "2485756e-9de3-4a66-86ab-edfcfe1df8fa",
"name": "empty-string",
"redirect_uri": {}
}
],
"total": 5
}

IMO only the first post is a correct request. However only the last post request fails with this response:
{"redirect_uri":"redirect_uri is not a array"}

So, only a valid array with at least one value should be accepted.

Thanks.

subnetmarco added a commit that referenced this issue May 31, 2016
@subnetmarco
Copy link
Member

This fix will be available in 0.8.3.

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

No branches or pull requests

4 participants