Space in name of authentication source causes problems for Keycloak #5919

Closed
opened 2025-11-02 06:40:17 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @jcollie on GitHub (Aug 30, 2020).

  • Gitea version (or commit ref): 1.12.3
  • Git version: 2.24.3
  • Operating system: Docker
  • 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 created an OAuth2/OpenID Connect authentication source to test out authentication with my new Keycloak server. When assigning an Authentication Name I used "keycloak test". This appears to have caused problems with Keycloak because of the space in the name. Changing the space to a dash character in Gitea fixes the error. I would think that url-encoding the space would have fixed the problem as well. Here's the error that I see in Keycloak's log:

03:07:45,157 WARN [org.keycloak.events] (default task-38) type=LOGIN_ERROR, realmId=test, clientId=gitea, userId=null, ipA
ddress=127.0.0.1, error=invalid_redirect_uri, redirect_uri='https://git.example.com/user/oauth2/keycloak test/callback'

Originally created by @jcollie on GitHub (Aug 30, 2020). - Gitea version (or commit ref): 1.12.3 - Git version: 2.24.3 - Operating system: Docker - 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 created an OAuth2/OpenID Connect authentication source to test out authentication with my new Keycloak server. When assigning an Authentication Name I used "keycloak test". This appears to have caused problems with Keycloak because of the space in the name. Changing the space to a dash character in Gitea fixes the error. I would think that url-encoding the space would have fixed the problem as well. Here's the error that I see in Keycloak's log: 03:07:45,157 WARN [org.keycloak.events] (default task-38) type=LOGIN_ERROR, realmId=test, clientId=gitea, userId=null, ipA ddress=127.0.0.1, error=invalid_redirect_uri, redirect_uri='https://git.example.com/user/oauth2/keycloak test/callback'
GiteaMirror added the type/bug label 2025-11-02 06:40:17 -06:00
Author
Owner

@zeripath commented on GitHub (Aug 30, 2020):

Thanks for alerting us.

@zeripath commented on GitHub (Aug 30, 2020): Thanks for alerting us.
Author
Owner

@jcollie commented on GitHub (Aug 31, 2020):

Thanks for fixing so quickly!

@jcollie commented on GitHub (Aug 31, 2020): Thanks for fixing so quickly!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5919