Hi Guys,
I am using Gitlab and Keycloak both are in docker. I want to integrate keycloak with GitLab.
Gitlab Docker-Compose file
version: '3'
services:
web:
image: 'gitlab/gitlab-ee:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '8000:80'
- '8443:443'
- '22:22'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
I have added the keycloak openid connect configuration in gitlab.rb file
gitlab_rails['omniauth_providers'] = [
{
name: "openid_connect",
label: "Provider name", # optional label for login button, defaults to "Openid Connect"
icon: "<custom_provider_icon>",
args: {
name: "openid_connect",
scope: ["openid","profile","email"],
response_type: "code",
issuer: "http://localhost:8080/auth/realms/gitlab",
discovery: true,
client_auth_method: "query",
uid_field: "54930368-97d2-41ae-9773-46e7cb094878",
send_scope_to_token_endpoint: "false",
client_options: {
identifier: "gitlab",
secret: "0002d554-38d0-4750-a144-33e3dd9abdb0",
redirect_uri: "https://localhost:8443/users/auth/openid_connect/callback",
end_session_endpoint: "http://localhost:8080/auth/realms/gitlab/protocol/openid-connect/logout",
authorization_endpoint: "http://localhost:8080/auth/realms/gitlab/protocol/openid-connect/auth",
token_endpoint: "http://localhost:8080/auth/realms/gitlab/protocol/openid-connect/token",
userinfo_endpoint: "http://localhost:8080/auth/realms/gitlab/protocol/openid-connect/userinfo",
jwks_uri: "http://localhost:8080/auth/realms/gitlab/protocol/openid-connect/certs"
}
}
}
]
But it doesn’t integrate with keycloak.
Can we pass the Openid connect values as env in Gitlab docker-compose file, and How can pass it
Gitlab installation: https://docs.gitlab.com/ee/install/docker.html
Keycloak integration:https://docs.gitlab.com/ee/administration/auth/oidc.html
Pls give the best solution