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 delete OAuth2 from consumer #1654

Closed
petrdvorak opened this issue Sep 18, 2016 · 7 comments
Closed

Unable to delete OAuth2 from consumer #1654

petrdvorak opened this issue Sep 18, 2016 · 7 comments
Milestone

Comments

@petrdvorak
Copy link

petrdvorak commented Sep 18, 2016

Summary

Whenever I try to delete OAuth 2 from a consumer, I get server error.

Steps To Reproduce

    1. Create a new API, consumer and OAuth2 on consumer
http POST http://192.168.99.100:8001/apis name=my-rest-api request_path=/openapi/v1/my-rest-api upstream_url=http://localhost:8080/provider strip_request_path=true

http http://192.168.99.100:8001/apis/my-rest-api/plugins/ name=oauth2 config.scopes=email,phone,address config.mandatory_scope=true config.enable_authorization_code=true

http POST http://192.168.99.100:8001/consumers/ username=apidemo

http POST http://192.168.99.100:8001/consumers/apidemo/oauth2/ name="Demo App" redirect_uri=http://getkong.org
    1. Try to delete OAuth 2 from the consumer:
http DELETE http://192.168.99.100:8001/consumers/apidemo/oauth2/1be17fe4-2555-4374-9c88-ef4d04d57af2

HTTP/1.1 500 Internal Server Error
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Sun, 18 Sep 2016 15:04:15 GMT
Server: kong/0.9.1
Transfer-Encoding: chunked

{
    "message": "An unexpected error occurred"
}

Additional Details & Logs

  • Kong version: 0.9.1
  • Operating System: Mac OS X 10.11.6, running in Docker
@subnetmarco
Copy link
Member

@petrdvorak are you using Cassandra or Postgres?

@petrdvorak
Copy link
Author

Thank you for looking into it - I use Cassandra.

@subnetmarco
Copy link
Member

@petrdvorak does creating the following index on Cassandra make it work?

CREATE INDEX IF NOT EXISTS ON oauth2_authorization_codes(credential_id);

@thibaultcha thibaultcha added this to the 0.9.2 milestone Sep 19, 2016
@petrdvorak
Copy link
Author

Hello @thefosk, yes - adding this index does help, OAuth2 credentials were removed after I called that DELETE method...

@subnetmarco
Copy link
Member

@petrdvorak I will submit a patch for 0.10 (since it cannot be included in 0.9.2 because a database schema operation is involved).

@petrdvorak
Copy link
Author

No problem, @thefosk - the workaround is quite viable...

@thibaultcha
Copy link
Member

Merged #1656, thanks for the report.

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