Skip to content

Instantly share code, notes, and snippets.

@kidig
Created September 25, 2018 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidig/ee567735312e1c5b2b61e1cf73de0e98 to your computer and use it in GitHub Desktop.
Save kidig/ee567735312e1c5b2b61e1cf73de0e98 to your computer and use it in GitHub Desktop.
Gitlab Yandex.OAuth Single Sign-On
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['Yandex']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
{
"name" => "oauth2_generic",
"app_id" => "your-app-id",
"app_secret" => "your-app-secret",
"args" => {
client_options: {
"site" => "https://oauth.yandex.ru",
"authorize_url" => "/authorize",
"token_url" => "/token",
"user_info_url" => "https://login.yandex.ru/info",
},
user_response_structure: {
attributes: {
name: 'login',
email: 'default_email',
first_name: 'first_name',
last_name: 'last_name'
}
},
redirect_url: 'http://your-gitlab-host/users/auth/Yandex/callback',
name: 'Yandex',
strategy_class: "OmniAuth::Strategies::OAuth2Generic"
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment