# GItlab integration with Keycloak

**URL:** <https://forum.keycloak.org/t/gitlab-integration-with-keycloak/20685>\
**Category:** Miscellanaeous\
**Tags:** oidc\
**Created:** [March 7, 2023, 11:42am UTC](https://forum.keycloak.org/t/gitlab-integration-with-keycloak/20685 "2023-03-07T11:42:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amruthapbhat](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/amruthapbhat/32/5710_2.png) [@amruthapbhat](https://forum.keycloak.org/u/amruthapbhat)\
**Post date:** [March 7, 2023, 11:42am UTC](https://forum.keycloak.org/t/gitlab-integration-with-keycloak/20685/1 "2023-03-07T11:42:51Z")

</div>

We are facing one issue with Gitlab integration with Keycloak. We are hosting a gitlab in a Kubernetes cluster using the below configuration which is integration with Keycloak.

prometheus\_monitoring[‘enable’] = false  
gitlab\_rails[‘ldap\_enabled’] = false;  
nginx[‘listen\_port’] = 10200  
nginx[‘listen\_https’] = false  
registry\_nginx[‘enable’] = true  
gitlab\_rails[‘registry\_path’] = “/mnt/docker\_registry”  
registry[‘enable’] = true  
registry\_external\_url ‘x.x.x.x’  
gitlab\_rails[‘initial\_root\_password’] = “x.x.x.x”  
external\_url ‘[x.x.x.x’]  
gitlab\_rails[‘lfs\_enabled’] = true  
gitlab\_rails[‘omniauth\_enabled’] = true  
gitlab\_rails[‘omniauth\_providers’] = [  
{ ‘name’ =\> ‘openid\_connect’,  
‘label’ =\> ‘Keycloak’,  
‘args’ =\> {  
‘name’ =\> ‘openid\_connect’,  
‘scope’ =\> [‘openid’,‘profile’,‘email’],  
‘response\_type’ =\> ‘code’,  
‘issuer’ =\> ‘[x,x,x,x’],  
‘discovery’ =\> true,  
‘client\_auth\_method’ =\> ‘query’,  
‘uid\_field’ =\> ‘preferred\_username’,  
‘send\_scope\_to\_token\_endpoint’ =\> ‘false’,  
‘client\_options’: {  
‘identifier’ =\> ‘devops’,  
‘secret’ =\> x.x.x.x’,  
‘redirect\_uri’ =\> ‘[x.x.x.x’]  
}  
}  
}  
]  
gitlab\_rails[‘omniauth\_auto\_link\_user’] = [‘keycloak’]  
gitlab\_rails[‘omniauth\_sync\_profile\_from\_provider’] = ‘openid\_connect’  
#gitlab\_rails[‘omniauth\_auto\_sign\_in\_with\_provider’] = ‘openid\_connect’  
gitlab\_rails[‘omniauth\_allow\_single\_sign\_on’] = [‘openid\_connect’]  
gitlab\_rails[‘omniauth\_auto\_link\_saml\_user’] = true  
gitlab\_rails[‘omniauth\_block\_auto\_created\_users’] = false  
gitlab\_rails[‘omniauth\_sync\_email\_from\_provider’] = ‘openid\_connect’  
gitlab\_rails[‘omniauth\_external\_providers’] = [‘openid\_connect’]  
gitlab\_rails[‘omniauth\_auto\_link\_user’] = [“openid\_connect”]  
gitlab\_rails[‘registry\_path’] = “/mnt/docker\_registry”  
gitlab\_rails[‘shared\_path’] = ‘/mnt/docker\_registry’  
registry[‘env’] = {“REGISTRY\_HTTP\_RELATIVEURLS” =\> true}  
registry[‘enable’] = true  
registry\_nginx[‘listen\_port’] = 8123  
registry\_nginx[‘listen\_https’] = false

The issue that we are facing is when a user is created from keycloak and that user tries to login into gitlab, then for that user the default project limit is getting set as 0 because of which that user is not able to create projects. This is happening only when we create a user from keycloak, but if we try to create a user from gitlab manually then the default project limit is being taken from the default settings.

Could you please let us know if there is any option that we can set in keycloak in order for us to have the default project value set for the users that are being created from keycloak.
