oauth.md 943 字节
Newer Older
1 2
# OAuth

D
dosire 已提交
3
You can use other services to log into GitLab via oAuth.
D
dosire 已提交
4

5 6 7 8 9 10
For this you need: 

* create app in selected services
* configure gitlab.yml 

## Twitter:
D
dosire 已提交
11

D
dosire 已提交
12
Below are screenshots how to setup your app on Twitter for this:
D
dosire 已提交
13 14 15 16

![Application details](twitter_app_details.png)
![API Keys](twitter_app_api_keys.png)

17
## GitHub:
D
dosire 已提交
18 19

![GitHub app](github_app.png)
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

## Google:

![Google app](google_app.png)


## GitLab config file

Second step is to modify gitlab.yml with app credentials:

```
production:
  ...

  omniauth:
    enabled: true
  
    providers:
      - { 
        name: 'twitter',
        app_id: 'XXXXXXXX',
        app_secret: 'XXXXXXXXXXXXXXXXXXXXXXXX'
        }
      - { 
        name: 'google_oauth2',
        app_id: 'XXXXXXXXXXX.apps.googleusercontent.com',
        app_secret: 'XXXXXXXX'
        }
      - { 
        name: 'github',
        app_id: 'XXXXXXXXXX',
        app_secret: 'XXXXXXXXXXXXXXXXXXXXXXXX'
        }

```