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

In auth plugins, support passing information about consumer to backing service #228

Closed
davidmc24 opened this issue May 12, 2015 · 5 comments
Assignees
Labels
idea/new plugin [legacy] those issues belong to Kong Nation, since GitHub issues are reserved for bug reports.
Milestone

Comments

@davidmc24
Copy link

Currently, when using the basicauth and keyauth plugins, a X-Consumer-ID header is added to the request, allowing the backing service to know who authenticated to Kong. However, unless the service has been told about the consumers through some other channel, it won't know who that consumer is.

One option would be for the service to call back to Kong and do a lookup via the Admin API's GET /consumers/{id} endpoint. However, the Admin API (at least in its current state) has no security, and isn't really something that you'd want various services calling back to.

A simpler solution would seem to be to add headers to the request to pass along the consumer's username/custom_id (perhaps X-Consumer-Username and X-Consumer-CustomID?) This would allow the backing service to base further authorization decisions on this information without calling back to Kong. If desired, this could be an optional feature turned on via the plugin configuration.

@sonicaghi
Copy link
Member

+1

@gavinhogan
Copy link

+1 - This will save us significant overhead on making additional calls from our API service to translate the consumer id back into the custom id.

@subnetmarco
Copy link
Member

Closed with 450f555. It will be available from the next version.

The new headers are X-Consumer-Custom-ID and X-Consumer-Username, along with the previous X-Consumer-ID.

@subnetmarco subnetmarco self-assigned this May 21, 2015
@subnetmarco subnetmarco added this to the 0.3.0 milestone May 21, 2015
@subnetmarco subnetmarco added the idea/new plugin [legacy] those issues belong to Kong Nation, since GitHub issues are reserved for bug reports. label May 21, 2015
@davidmc24
Copy link
Author

Great! Thanks, @thefosk!

@gavinhogan
Copy link

Awesome thanks @thefosk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea/new plugin [legacy] those issues belong to Kong Nation, since GitHub issues are reserved for bug reports.
Projects
None yet
Development

No branches or pull requests

4 participants