Skip to content

OpenID redirect loop #26097

Closed
Closed
@otbutz

Description

@otbutz

Description

I'm using gitea as an OpenID provider for Jenkins. Everything works as long as the user is already logged into gitea. If there's no valid Jenkins/gitea session, the user is properly guided to the gitea login page. The problem starts after hitting the Login button:

2023-07-24_16-01

The initial POST request to /user/login contains the username and password entered in the login form. The server answers with a HTTP 303 status code and the location /login/oauth/authorize with a few query parameters. The redirect_uri parameter of this request points to my Jenkins instance: https://jenkins.mydomain.com/securityRealm/finishLogin

The problem is that this ends up in a redirect loop as /login/oauth/authorize will also answer with HTTP 303 pointing to /user/login. Firefox ultimately errors out with a NS_ERROR_REDIRECT_LOOP.

The authentication itself works though. I can successfully open gitea or jenkins afterwards with a valid user session.

The configuration in Jenkins is pretty barebones:

2023-07-24_16-13

Gitea Version

1.20.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary started via systemd behind a caddy reverse proxy.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detailtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions