# Gitea meets Keycloak - Gitea beginner questions

**URL:** <https://forum.gitea.com/t/gitea-meets-keycloak-gitea-beginner-questions/11011>\
**Category:** Install/Maintain/Configure\
**Created:** [March 25, 2025, 11:53pm UTC](https://forum.gitea.com/t/gitea-meets-keycloak-gitea-beginner-questions/11011 "2025-03-25T23:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trezzi](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@trezzi](https://forum.gitea.com/u/trezzi)\
**Post date:** [March 25, 2025, 11:53pm UTC](https://forum.gitea.com/t/gitea-meets-keycloak-gitea-beginner-questions/11011/1 "2025-03-25T23:53:56Z")

</div>

Hey everyone,

so we are just started with Gitea and want to tie it up with our Keycloak which has a LDAP as user federation. (Actually using a dev instance with just a keycloak admin user, when that works we will use the actual prod keycloak with ldap users)

In this regard there are two questions:

- it seems like we have successful added keycloak as OAuth2 provider, but what would the redirect url need to look like? I can only find documentation for when Gitea get used as Identity provider and i dont like to use a wildcard
- Actually the keycloak we connected is a dev instance and dont has users as just the keycloak admin itself (testing purposes). When we try to login as that user, we can’t login cause the self-registering is deactivated (as wanted) and it does not got synchronized after connecting keycloak as OAuth2 provider.

Thank you in advance.

Best regards  
trezzi

---

<div class="post-metadata">

**Author:** ![trezzi](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@trezzi](https://forum.gitea.com/u/trezzi)\
**Post date:** [March 26, 2025, 12:38pm UTC](https://forum.gitea.com/t/gitea-meets-keycloak-gitea-beginner-questions/11011/2 "2025-03-26T12:38:14Z")

</div>

> [@trezzi](#):
>
> Actually the keycloak we connected is a dev instance and dont has users as just the keycloak admin itself (testing purposes). When we try to login as that user, we can’t login cause the self-registering is deactivated (as wanted) and it does not got synchronized after connecting keycloak as OAuth2 provider.

That is solved, `oauth2_client` needed `ENABLE_AUTO_REGISTRATION`

> [@trezzi](#):
>
> it seems like we have successful added keycloak as OAuth2 provider, but what would the redirect url need to look like? I can only find documentation for when Gitea get used as Identity provider and i dont like to use a wildcard

That’s still open

---

<div class="post-metadata">

**Author:** ![yacinebbt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/yacinebbt/32/6796_2.png) [@yacinebbt](https://forum.gitea.com/u/yacinebbt)\
**Post date:** [April 9, 2025, 2:48pm UTC](https://forum.gitea.com/t/gitea-meets-keycloak-gitea-beginner-questions/11011/3 "2025-04-09T14:48:04Z")

</div>

Hello,  
in keycloak you should configure your client and set the Valid redirect URIs value to:  
https://YOUR\_PUBLIC\_DOMAINE.NAME/user/oauth2/${Authentication name}/callback

while ${Authentication name} is the name you already set up using gitea gui and that can be found here: https://YOUR\_PUBLIC\_DOMAINE.NAME/admin/auths/

Regards,  
Yacine
