Generic OAuth: customize login and id_token attributes (#26577)

* OAuth: add login_attribute_path to generic oauth

* OAuth: remove default client_secret values (able to use empty client_secret)

* OAuth: allow to customize id_token attribute name

* Docs: describe how login_attribute_path and id_token_attribute_name params work

* Docs: review fixes

* Docs: review fixes

* Chore: fix go linter error

* Tests: fix test code style
This commit is contained in:
Alexander Zobnin
2020-08-03 17:33:27 +03:00
committed by GitHub
parent fa7c4d91aa
commit df11cdad62
6 changed files with 135 additions and 9 deletions
+9
View File
@@ -59,6 +59,15 @@ Check for the presence of a role using the [JMESPath](http://jmespath.org/exampl
See [JMESPath examples](#jmespath-examples) for more information.
> Only available in Grafana v7.2+.
Customize user login using `login_attribute_path` configuration option. Order of operations is as follows:
1. Grafana evaluates the `login_attribute_path` JMESPath expression against the ID token.
1. If Grafana finds no value, then Grafana evaluates expression against the JSON data obtained from UserInfo endpoint. The UserInfo endpoint URL is specified in the `api_url` configuration option.
You can customize the attribute name used to extract the ID token from the returned OAuth token with the `id_token_attribute_name` option.
## Set up OAuth2 with Auth0
1. Create a new Client in Auth0