gitlab_rails['omniauth_enabled']=true# 开启omniauth gitlab_rails['omniauth_allow_single_sign_on']=true# 此处值为true的话,当gitlab不存在该用户时会自动在gitlab中创建用户 gitlab_rails['omniauth_block_auto_created_users']=false# 是否禁用自动创建的gitlab用户 ,为false则表示自动创建的用户不禁用。为true时则表示禁用,需要gitlab管理员手动解除禁用 gitlab_rails['omniauth_auto_link_user']=true# 是否自动关联已经存在的gitlab账号 gitlab_rails['omniauth_providers']=[{'name'=>'oauth2_generic','app_id'=>'xxxxx',# oauth2的app_id 由sso服务进行分配'app_secret'=>'xxxxx',# oauth2的app_secret 由sso服务进行分配'args'=>{client_options:{'site'=>'http://127.0.0.1:9001',# sso的地址'authorize_url'=>'/sso/login',# 认证URL'token_url'=>'/sso/api/oauth/gitlab',# 获取token的URL'user_info_url'=>'/sso/api/user'# 获取用户信息的URL},user_response_structure:{root_path:[],# i.e. if attributes are returned in JsonAPI format (in a 'user' node nested under a 'data' node)id_path:['uid'],# 此处的用户信息如何配置 我会在下面详细说明attributes:{ name:'username', nickname:'nickname',email:'email'}# 此处的用户信息如何配置 我会在下面详细说明# optionally, you can add the following two lines to "white label" the display name# of this strategy (appears in urls and Gitlab login buttons)# If you do this, you must also replace oauth2_generic, everywhere it appears above, with the new name. name:'SSO',# 此处的属性值会在登陆处,以及设置identitifier时使用到,建议英文(不支持中文)strategy_class:"OmniAuth::Strategies::OAuth2Generic"# Devise-specific config option Gitlab uses to find renamed strategy}} ]