Where can get a Java simple sample, which can work with [auth.generic_oauth] part in grafana.ini?


We can see the following these configurable content from OAuth authentication | Grafana Labs, I want to know where we can get a Java simple sample which can provide OAuth2 authentication services and work with Grafana

enabled = true
client_id = YOUR_APP_CLIENT_ID
client_secret = YOUR_APP_CLIENT_SECRET
scopes =
auth_url =
token_url =
api_url =

You need Identity Provider implementation (IdP), which support Open ID Connect (OIDC) protocol. You can choose from Libraries, Products, and Tools | OpenID but don’t expect “simple” sample.

BTW you may have full IdP server with a few commands in the container. E.g. Keycloak:

docker run -d \
  --name keycloak \
  -p 443:8443 \
  -e KEYCLOAK_USER=admin \

See: Docker Hub