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

User-based authentication credentials #15

Merged
merged 4 commits into from
Nov 7, 2022

Conversation

kostrse
Copy link
Collaborator

@kostrse kostrse commented Oct 14, 2022

Adding two new credential types:

  • azcredentials.AadCurrentUserCredentials
  • azcredentials.AzureClientSecretOboCredentials

These credentials assume that authentication into a datasource performed using identity of the currently signed-in AAD user, as opposed to a service identity credentials stored with the datasource.

The user identity credentials can be supported only in scenarios where Grafana configured with AAD user authentication.

AadCurrentUserCredentials

Zero configuration "Current User" authentication. Assumes that all settings required for successful access token exchange are configured at the level of Grafana instance and there's no input required from the end user.

Similar to "access token pass-thru" but in case of pass-thru the access token is being sent to a datasource "as is", and in this case, a datasource scoped access token is being properly requested from an identity provider configured with Grafana instance.

This is credential type definition and it doesn't govern how specifically identity provider should be configured at the Grafana instance level (this is responsibility of a token provider implementation).

AzureClientSecretOboCredentials

"App Registration (on-behalf-of)" is similar to "Current User" with only difference is that AAD identity provider and AAD app provided by the user rather than configured at the Grafana instance level.

Configuration schema is identical to "App Registration" (aka client secret) but instead of requesting access token for the configured service identity itself, the service identity used to request an access token on-behalf-of currently signed user.

@kostrse kostrse merged commit fe6b405 into grafana:main Nov 7, 2022
@kostrse kostrse deleted the user-auth-credentials branch November 7, 2022 20:06

import "fmt"

func GetMap(obj map[string]interface{}, key string) (map[string]interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better to define types for the different structs rather than having to maintain this package and use untyped maps. It's more prone to errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants