35 lines
1.5 KiB
Markdown
35 lines
1.5 KiB
Markdown
# Gitlab OIDC 연동 (authentik)
|
|
Gitlab에 OIDC 연동을 위해 keycloak를 사용 하였으나, 이번에 authentik으로 변경하면서 설정한 내용 기록<br>
|
|
사전에 미리 Gitlab과 Authentik가 설치 되어 있어 있고, 공급자와 애플리케이션 추가가 완료 되어 있는 상태에서 진행
|
|
|
|
## Gitlab 설정
|
|
`gitlab.rb` 파일에 아래의 내용 설정
|
|
|
|
```yaml
|
|
gitlab_rails['omniauth_enabled'] = true
|
|
gitlab_rails['omniauth_allow_single_sign_on'] = ['openid_connect']
|
|
gitlab_rails['omniauth_block_auto_created_users'] = true # 활성화 시켜주어야 oidc 로그인을 할 경우 계정 자동 생성
|
|
gitlab_rails['omniauth_auto_link_user'] = ['openid_connect']
|
|
gitlab_rails['omniauth_providers'] = [
|
|
{
|
|
name: "openid_connect", # 변경 하지 않음
|
|
label: "Authentik Login", # 로그인 버튼의 텍스트
|
|
icon: "https://static-00.iconduck.com/assets.00/authentik-orange-icon-512x391-4kzut6y1.png", # 로그인 버튼에 들어갈 아이콘
|
|
args: {
|
|
name: "openid_connect",
|
|
scope: ["openid","profile","email"],
|
|
response_type: "code",
|
|
issuer: "https://auth.jhcloud.kr/application/o/gitlab/",
|
|
discovery: true,
|
|
client_auth_method: "query", # default가 query 이며, basic , jwt_bearer , mtls 가 있음
|
|
send_scope_to_token_endpoint: "false",
|
|
pkce: true,
|
|
client_options: {
|
|
identifier: "", # 클라이언트 ID
|
|
secret: "", # 클라이언트 Secret
|
|
redirect_uri: "https://lab.jhcloud.kr/users/auth/openid_connect/callback"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
``` |