grafana/docs/sources/setup-grafana/configure-security/configure-authentication
Jo 1e1fd3db38
OAuth: Add access token as third source for user info extraction (#107636)
* Add access token as third source for user info extraction

- Add extractFromAccessToken method to extract user info from JWT access tokens
- Mutualize code by creating parseUserInfoFromJSON helper method
- Rename methods for clarity: extractFromToken -> extractFromIDToken, retrieveRawIDToken -> retrieveRawJWTPayload
- Update test suite to include comprehensive access token retrieval scenarios
- Support three sources in priority order: ID token, API response, access token
- Maintain backward compatibility while adding new functionality

* Update Generic OAuth documentation to reflect access token support

- Add access token as a third source for user information extraction
- Update configuration sections to mention access tokens alongside ID tokens and UserInfo endpoint
- Document the priority order: ID token → UserInfo endpoint → access token
- Update configuration option descriptions to reflect new functionality
- Maintain consistency with implementation changes

* Refactor access token test cases to use parameter instead of hardcoded logic

- Add AccessToken field to test case struct for explicit access token specification
- Remove hardcoded string matching logic that determined access token based on test name
- Update all access token test cases to include the AccessToken field with appropriate JWT values
- Improve test maintainability and clarity by making access tokens explicit parameters
- Remove unused strings import that was only needed for the hardcoded logic

* fix doc lint

* reduce cyclomatic complexity
2025-07-08 15:38:11 +02:00
..
anonymous-auth Revert "Anonymous: Enforce org role Viewer setting (#102070)" (#103043) 2025-03-31 10:31:53 +01:00
auth-proxy Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
azuread Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
enhanced-ldap Docs: removing docs debt in install docs (#101750) 2025-04-09 09:02:51 -05:00
generic-oauth OAuth: Add access token as third source for user info extraction (#107636) 2025-07-08 15:38:11 +02:00
github Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
gitlab Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
google Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
grafana Docs: removing docs debt in install docs (#101750) 2025-04-09 09:02:51 -05:00
grafana-cloud docs: rewrite grafana-com oauth to better align with naming conventions (#84294) 2024-03-12 10:38:43 -05:00
jwt Fix all the old usage of admonition syntax (#106984) 2025-06-19 17:31:13 +01:00
keycloak Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
keycloak-multitenant Fix all the old usage of admonition syntax (#106984) 2025-06-19 17:31:13 +01:00
ldap Docs: removing docs debt in install docs (#101750) 2025-04-09 09:02:51 -05:00
ldap-ui Docs: removing docs debt in install docs (#101750) 2025-04-09 09:02:51 -05:00
okta Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
passwordless Docs: removing docs debt in install docs (#101750) 2025-04-09 09:02:51 -05:00
saml Docs: Updating team sync availability (#107721) 2025-07-07 16:07:50 -05:00
_index.md SCIM: Update authentication features table (#107299) 2025-06-27 16:58:29 +02:00