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

Added support for "token_url_params" configuration #20940

Closed
yinzara opened this issue Dec 6, 2019 · 1 comment
Closed

Added support for "token_url_params" configuration #20940

yinzara opened this issue Dec 6, 2019 · 1 comment

Comments

@yinzara
Copy link

yinzara commented Dec 6, 2019

There are many custom oauth systems that require additional parameters be specified during the token exchange part of the oauth 2.0 specification. Specifically additional HTTP form parameters should be sent as part of the POST to the "token_url" (from the custom oauth configuration of Grafana).

with Auth0, the "audience" parameter is required in a specific scenario (but can't avoided if you need this scenario supported) however this scenario should be the preferred configuration of Auth0 with Grafana.

After successful login, the access token returned by Auth0 by default (if no audience is specified and no default audience is configured at the tenant level [the default]) will be an opaque token (not a JWT). If you have backend services that require a JWT (i.e. most of us), then you must first have a defined "Auth0 resource server" (or API in some docs) that corresponds to your backend and you must specify its API identifier (it's URL like) as either the default audience in the Auth0 tenant config or you must send the "audience" http form parameter on the token exchange (or in SPA, on the authorize URL).

If I want to use RBAC in Auth0 to control my roles in Grafana, assuming you already have another resource server in Auth0 that's my primary resource server (and its API identifier is probably set as the default audience in your auth0 tenant) and I want to add support for Grafana, I either need to add the Grafana permissions to the primary resource server (which I don't want to do as they aren't related to it) or I need to create a second resource server that corresponds to Grafana and specify the Grafana permissions there.

If I do that (i.e. correctly segregate my resource servers/APIs), then I am required to send the "audience" parameter as part of the token exchange or it will not correctly enforce RBAC and also will issue the JWT token with the wrong "aud".

Currently the only option is to send it as a HTTP query string paramter in the "token_url" however Auth0 will only accept it if it's part of the HTTP form post body.

I purpose the addition of a new token_url_params configuration option on the oauth configuration section of Grafana that accepts a query string in standard escaped format (i.e. for use in url.ParseQuery in Golang) that specifies additional form parameters be sent during the POST to the Oauth token_url endpoint.

I have already completed the work in the #20884

@papagian papagian added this to Inbox in Backend Platform Backlog via automation Dec 8, 2019
@papagian papagian removed this from Inbox in Backend Platform Backlog Dec 8, 2019
@aknuds1 aknuds1 added the needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating label Dec 10, 2019
@aknuds1 aknuds1 self-assigned this Dec 10, 2019
@aknuds1 aknuds1 added this to In progress in Backend Platform Squad Dec 10, 2019
@aknuds1 aknuds1 moved this from In progress to Under review in Backend Platform Squad Jan 3, 2020
@aknuds1 aknuds1 removed this from Under review in Backend Platform Squad Feb 13, 2020
@marefr marefr removed the needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating label Jun 15, 2020
@kminehart
Copy link
Contributor

It looks like the pull request #20884 was closed and there was some good discussion as to why in that issue. If this is something that is still needed, feel free to comment here or open a new issue and we can discuss it. :)

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

5 participants