Authentication¶
The Micromegas Grafana plugin supports two authentication methods.
Authentication Methods¶
API Keys¶
Simple authentication using a static API key.
- Best for: Development, small deployments, quick start
OAuth 2.0 Client Credentials¶
Enterprise authentication via identity provider (Google, Auth0, Azure AD, Okta).
- Best for: Production, enterprise deployments
API Key Authentication¶
Quick Setup¶
-
Generate API Key:
-
Configure server (see Admin Guide):
-
Configure Grafana datasource:
- Auth Method: API Key
- API Key: Paste your generated key
- Save & Test
OAuth 2.0 Client Credentials¶
Quick Setup¶
- Create service account in your identity provider:
- Google: Service account with JSON key
- Auth0: Machine-to-Machine application
- Azure AD: App registration with client secret
-
Okta: Service app
-
Configure server with OIDC settings (see Admin Guide)
-
Configure Grafana datasource:
- Auth Method: OAuth 2.0 Client Credentials
- OIDC Issuer: Your provider URL
- Client ID: From step 1
- Client Secret: From step 1
- Audience: (Auth0/Azure AD only)
- Enable User Attribution: On (default) or Off
- Save & Test
Privacy Settings¶
Enable User Attribution controls whether user information is sent with queries:
- Enabled (default): Grafana username and email are logged on the server for audit purposes
- Disabled: Only the service account identity is logged
User attribution provides an audit trail showing which Grafana user ran which queries. This is separate from authentication (the service account authenticates the connection).
Provider URLs¶
| Provider | Issuer URL |
|---|---|
https://accounts.google.com |
|
| Auth0 | https://YOUR-TENANT.auth0.com |
| Azure AD | https://login.microsoftonline.com/TENANT-ID/v2.0 |
| Okta | https://YOUR-DOMAIN.okta.com |
Example: Auth0¶
Create a Machine-to-Machine application in Auth0:
- Go to Applications → Create Application
- Choose "Machine to Machine Applications"
- Select your API or create a new API identifier
- Copy the Client ID and Client Secret
Grafana Configuration:
Auth Method: OAuth 2.0 Client Credentials
OIDC Issuer: https://YOUR-TENANT.auth0.com
Client ID: (from Auth0 application)
Client Secret: (from Auth0 application)
Audience: https://your-api-identifier (your API identifier from Auth0)
Example: Google Cloud¶
# Create service account
gcloud iam service-accounts create grafana-prod \
--display-name="Grafana Micromegas Datasource"
# Create key
gcloud iam service-accounts keys create credentials.json \
--iam-account=grafana-prod@PROJECT.iam.gserviceaccount.com
Grafana Configuration:
Auth Method: OAuth 2.0 Client Credentials
OIDC Issuer: https://accounts.google.com
Client ID: grafana-prod@PROJECT.iam.gserviceaccount.com
Client Secret: (from credentials.json)
Testing¶
Click Save & Test to verify connection and authentication.