Single Sign-On with OAuth2 provider (Keycloak) is not login single sign-on #1997

Closed
opened 2025-11-02 04:20:35 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @devent on GitHub (Jul 2, 2018).

  • Gitea version (or commit ref): 1.4.1
  • Git version: 2.15.0
  • Operating system: Debian Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'm using Keycloak as a SSO solution and have configured Gitea to use OAuth2 authentication. That works fine. I have also Jenkins using the same SSO solution.

The problem is that if I login into Jenkins as the same user then I'm not logged in in Gitea. I was thinking that in SSO Keycloak I only need to be logged in once in any application and it will logged me everywhere. I need to login separately in Gitea.

After I click on Sign In and Sign In Using Openid Connect I'm logged in without password.

Is that the expected behavior?

My expectation would be that after I logged in into Jenkins then I'm also automatically logged in into Gitea without the need to click on Sign In Using Openid Connect.
...

Screenshots

grafik

grafik

grafik

grafik

Originally created by @devent on GitHub (Jul 2, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.4.1 - Git version: 2.15.0 - Operating system: Debian Linux - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description I'm using Keycloak as a SSO solution and have configured Gitea to use OAuth2 authentication. That works fine. I have also Jenkins using the same SSO solution. The problem is that if I login into Jenkins as the same user then I'm not logged in in Gitea. I was thinking that in SSO Keycloak I only need to be logged in once in any application and it will logged me everywhere. I need to login separately in Gitea. After I click on Sign In and Sign In Using Openid Connect I'm logged in without password. Is that the expected behavior? My expectation would be that after I logged in into Jenkins then I'm also automatically logged in into Gitea without the need to click on Sign In Using Openid Connect. ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![grafik](https://user-images.githubusercontent.com/82924/42158616-453d171c-7df1-11e8-9e73-e860f1de6cfd.png) ![grafik](https://user-images.githubusercontent.com/82924/42158644-5949f6ee-7df1-11e8-8ddc-42037046459d.png) ![grafik](https://user-images.githubusercontent.com/82924/42158676-6e7f74ee-7df1-11e8-829b-109f17ad0681.png) ![grafik](https://user-images.githubusercontent.com/82924/42158735-9e2d738a-7df1-11e8-9085-8d56d84b54e2.png)
GiteaMirror added the type/question label 2025-11-02 04:20:35 -06:00
Author
Owner

@lafriks commented on GitHub (Jul 2, 2018):

Gitea can not possibility know and should not know about other sessions you have with this SSO. So you still have to click sign in in gitea just like if you would first sign in in gitea and later you would still be required to sing in into Jenkins. You should not be asked for password when signing in tho

@lafriks commented on GitHub (Jul 2, 2018): Gitea can not possibility know and should not know about other sessions you have with this SSO. So you still have to click sign in in gitea just like if you would first sign in in gitea and later you would still be required to sing in into Jenkins. You should not be asked for password when signing in tho
Author
Owner

@devent commented on GitHub (Jul 3, 2018):

Then I had the wrong idea what SSO means. Thank you. Yes, I don't need to enter any password to login in Gitea if I'm already logged in into Jenkins.

@devent commented on GitHub (Jul 3, 2018): Then I had the wrong idea what SSO means. Thank you. Yes, I don't need to enter any password to login in Gitea if I'm already logged in into Jenkins.
Author
Owner

@CRCinAU commented on GitHub (Jul 14, 2019):

I know this is a bit off topic - but is there any link to how to configure gitea to use keycloak as an auth source? My Google-foo has turned up nothing :(

@CRCinAU commented on GitHub (Jul 14, 2019): I know this is a bit off topic - but is there any link to how to configure gitea to use keycloak as an auth source? My Google-foo has turned up nothing :(
Author
Owner

@devent commented on GitHub (Jul 15, 2019):

If I remember correctly, you just add in the config:

    [openid]
    ENABLE_OPENID_SIGNIN = true
    ENABLE_OPENID_SIGNUP = false

After that you can configure the OpenID in Gitea itself.

grafik

@devent commented on GitHub (Jul 15, 2019): If I remember correctly, you just add in the config: ``` [openid] ENABLE_OPENID_SIGNIN = true ENABLE_OPENID_SIGNUP = false ``` After that you can configure the OpenID in Gitea itself. ![grafik](https://user-images.githubusercontent.com/82924/61207737-225a0000-a6f6-11e9-862b-238d93becfbf.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1997