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
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: