Skip to content

Commit

Permalink
Add config setup to docs (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
gamab authored Oct 5, 2023
1 parent 5e6efa2 commit 0532f8b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion examples/app-with-on-behalf-of-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@

This plugin is an example of how to integrate OAuth2 authentication into a Grafana plugin.

**Note:** This plugin requires Grafana 10.1 or later and the `externalServiceAuth` feature toggle must be enabled. This is an experimental feature.
**Note:** This plugin requires Grafana 10.1 or later

## How to use

This app allows you to do requests to the Grafana API as the plugin or on behalf of a user (by specifying the user ID). The plugin will then use the access token to do requests to the Grafana API.

![screenshot](./src/img/screenshot-showcase.png)

## Grafana configuration

This is an experimental feature, the `externalServiceAuth` feature toggle must be enabled.

Additionally, Grafana needs `auth.extended_jwt` to be enabled and configured. Set your audience and issuer to your base URL. Example:

```ini
[auth.extended_jwt]
enabled = true
expect_audience = http://localhost:3000/
expect_issuer = http://localhost:3000/
```

## Authentication flow

The plugin uses the [JWT Bearer Assertion OAuth2 Extension](https://datatracker.ietf.org/doc/html/rfc7523) to authenticate users and obtain an access token that can be used to authorize requests against the Grafana API. To enable it, add the section below to your `plugin.json` file.
Expand Down

0 comments on commit 0532f8b

Please sign in to comment.