OAuth2 OIDC singin issue - invalid character #5125

Closed
opened 2025-11-02 06:15:10 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @bibiak1 on GitHub (Mar 26, 2020).

  • Gitea version (or commit ref): 1.11.3 built with GNU Make 4.2.1, go1.13.8 : bindata, sqlite, sqlite_unlock_notify
  • Git version: 2.24.1
  • Operating system: docker image gitea/gitea:1
  • 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 have an issue when using OIDC:
routers/user/auth.go:590:handleOAuth2SignIn() [E] UserSignIn: invalid character '<' looking for beginning of value

OIDC is configured with those options (do not know if it's relevant):

  • Scope: openid
  • Pre Authorized Scope: openid
  • Response Types:
    • Code: Yes
    • ID Token: No
    • Token: Yes
    • Allow Introspect? No
    • Allow Refresh Grant? No
    • Token Endpoint Auth Method: clientSecretPost

Those value can be changed if needed

Please support
...

Screenshots

Originally created by @bibiak1 on GitHub (Mar 26, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) 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.11.3 built with GNU Make 4.2.1, go1.13.8 : bindata, sqlite, sqlite_unlock_notify - Git version: 2.24.1 - Operating system: docker image gitea/gitea:1 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description I have an issue when using OIDC: routers/user/auth.go:590:handleOAuth2SignIn() [E] UserSignIn: invalid character '<' looking for beginning of value OIDC is configured with those options (do not know if it's relevant): - Scope: openid - Pre Authorized Scope: openid - Response Types: - Code: Yes - ID Token: No - Token: Yes - Allow Introspect? No - Allow Refresh Grant? No - Token Endpoint Auth Method: clientSecretPost Those value can be changed if needed Please support ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/questionissue/stale labels 2025-11-02 06:15:10 -06:00
Author
Owner

@lafriks commented on GitHub (Mar 26, 2020):

This needs more information. To me it looks like OIDC server is returning html somewhere where it is expected to return json.

@lafriks commented on GitHub (Mar 26, 2020): This needs more information. To me it looks like OIDC server is returning html somewhere where it is expected to return json.
Author
Owner

@bibiak1 commented on GitHub (Mar 26, 2020):

2020/03/26 12:50:39 Started GET /user/oauth2/xxx for 9.145.2.40
2020/03/26 12:50:39 Completed GET /user/oauth2/xxx 307 Temporary Redirect in 76.611366ms
2020/03/26 12:50:40 Started GET /user/oauth2/xxx/callback?code=06f6VcZ0UEheWD68TWPKiQ7KoRAImS&state=b96e0d29-0716-4b19-95d3-8910be47fb01 for 9.145.2.40
2020/03/26 12:50:41 Started GET /serviceworker.js for 9.145.2.40
2020/03/26 12:50:41 Completed GET /serviceworker.js 200 OK in 1.037095ms
2020/03/26 12:50:41 Completed GET /user/oauth2/xxx/callback?code=06f6VcZ0UEheWD68TWPKiQ7KoRAImS&state=b96e0d29-0716-4b19-95d3-8910be47fb01 500 Internal Server Error in 1.047477358s

@bibiak1 commented on GitHub (Mar 26, 2020): > 2020/03/26 12:50:39 Started GET /user/oauth2/xxx for 9.145.2.40 2020/03/26 12:50:39 Completed GET /user/oauth2/xxx 307 Temporary Redirect in 76.611366ms 2020/03/26 12:50:40 Started GET /user/oauth2/xxx/callback?code=06f6VcZ0UEheWD68TWPKiQ7KoRAImS&state=b96e0d29-0716-4b19-95d3-8910be47fb01 for 9.145.2.40 2020/03/26 12:50:41 Started GET /serviceworker.js for 9.145.2.40 2020/03/26 12:50:41 Completed GET /serviceworker.js 200 OK in 1.037095ms 2020/03/26 12:50:41 Completed GET /user/oauth2/xxx/callback?code=06f6VcZ0UEheWD68TWPKiQ7KoRAImS&state=b96e0d29-0716-4b19-95d3-8910be47fb01 500 Internal Server Error in 1.047477358s
Author
Owner

@bibiak1 commented on GitHub (Mar 26, 2020):

I can provide more logs - just let me know what I need to do to get it as you want

@bibiak1 commented on GitHub (Mar 26, 2020): I can provide more logs - just let me know what I need to do to get it as you want
Author
Owner

@bibiak1 commented on GitHub (Mar 26, 2020):

Maybe it's a matter of application type - I have choose OTHER

image

@bibiak1 commented on GitHub (Mar 26, 2020): Maybe it's a matter of application type - I have choose OTHER ![image](https://user-images.githubusercontent.com/24386585/77646911-bfe41f80-6f65-11ea-87bf-052a3a7c49d3.png)
Author
Owner

@bibiak1 commented on GitHub (Apr 2, 2020):

Looks like my oauth2 service requires JWT Certificate to be present in query

@bibiak1 commented on GitHub (Apr 2, 2020): Looks like my oauth2 service requires JWT Certificate to be present in query
Author
Owner

@stale[bot] commented on GitHub (Jun 2, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Jun 2, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Jun 17, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Jun 17, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5125