mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #12153 from grafana/googleOAuthDocs
update google auth config docs
This commit is contained in:
@@ -419,25 +419,33 @@ allowed_organizations = github google
|
|||||||
|
|
||||||
## [auth.google]
|
## [auth.google]
|
||||||
|
|
||||||
You need to create a Google project. You can do this in the [Google
|
First, you need to create a Google OAuth Client:
|
||||||
Developer Console](https://console.developers.google.com/project). When
|
|
||||||
you create the project you will need to specify a callback URL. Specify
|
|
||||||
this as callback:
|
|
||||||
|
|
||||||
```bash
|
1. Go to https://console.developers.google.com/apis/credentials
|
||||||
http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/google
|
|
||||||
```
|
|
||||||
|
|
||||||
This callback URL must match the full HTTP address that you use in your
|
2. Click the 'Create Credentials' button, then click 'OAuth Client ID' in the
|
||||||
browser to access Grafana, but with the prefix path of `/login/google`.
|
menu that drops down
|
||||||
When the Google project is created you will get a Client ID and a Client
|
|
||||||
Secret. Specify these in the Grafana configuration file. For example:
|
3. Enter the following:
|
||||||
|
|
||||||
|
- Application Type: Web Application
|
||||||
|
- Name: Grafana
|
||||||
|
- Authorized Javascript Origins: https://grafana.mycompany.com
|
||||||
|
- Authorized Redirect URLs: https://grafana.mycompany.com/login/google
|
||||||
|
|
||||||
|
Replace https://grafana.mycompany.com with the URL of your Grafana instance.
|
||||||
|
|
||||||
|
4. Click Create
|
||||||
|
|
||||||
|
5. Copy the Client ID and Client Secret from the 'OAuth Client' modal
|
||||||
|
|
||||||
|
Specify the Client ID and Secret in the Grafana configuration file. For example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
[auth.google]
|
[auth.google]
|
||||||
enabled = true
|
enabled = true
|
||||||
client_id = YOUR_GOOGLE_APP_CLIENT_ID
|
client_id = CLIENT_ID
|
||||||
client_secret = YOUR_GOOGLE_APP_CLIENT_SECRET
|
client_secret = CLIENT_SECRET
|
||||||
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
|
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
|
||||||
auth_url = https://accounts.google.com/o/oauth2/auth
|
auth_url = https://accounts.google.com/o/oauth2/auth
|
||||||
token_url = https://accounts.google.com/o/oauth2/token
|
token_url = https://accounts.google.com/o/oauth2/token
|
||||||
|
|||||||
Reference in New Issue
Block a user