Cannot login planka with Forgejo's OAuth2, please help me! #509

Closed
opened 2026-02-04 20:03:48 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @zyppe on GitHub (May 18, 2024).

I want to connect it, so I added an OAuth2 application in my Forgejo (a gitea's fork), and I add these items in the configuration: OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET. Then it can show login with SSO and jumped to my Forgejo, but when I login in, it just tell me UNKNOWN ERROR. What items do I ignored?
Here is the document about Forgejo as OAuth2 provide:
https://docs.gitea.com/development/oauth2-provider

Originally created by @zyppe on GitHub (May 18, 2024). I want to connect it, so I added an OAuth2 application in my Forgejo (a gitea's fork), and I add these items in the configuration: OIDC_ISSUER, OIDC_CLIENT_ID, OIDC_CLIENT_SECRET. Then it can show login with SSO and jumped to my Forgejo, but when I login in, it just tell me UNKNOWN ERROR. What items do I ignored? Here is the document about Forgejo as OAuth2 provide: https://docs.gitea.com/development/oauth2-provider
OVERLORD added the help wanted label 2026-02-04 20:03:48 +03:00
Author
Owner

@eternity1984 commented on GitHub (Jun 24, 2024):

@zyppe
How is OIDC_ISSUER set in your environment?

# Incorrect
OIDC_ISSUER=https://forgejo.DOMAIN.TLD/.well-known/openid-configuration
OIDC_ISSUER=https://forgejo.DOMAIN.TLD

# Correct
OIDC_ISSUER=https://forgejo.DOMAIN.TLD/

The following error probably occurred internally.

[server]  warn: Error while exchanging OIDC code: RPError: iss mismatch, expected https://forgejo.DOMAIN.TLD/, got: https://forgejo.DOMAIN.TLD/.well-known/openid-configuration
@eternity1984 commented on GitHub (Jun 24, 2024): @zyppe How is OIDC_ISSUER set in your environment? ```env # Incorrect OIDC_ISSUER=https://forgejo.DOMAIN.TLD/.well-known/openid-configuration OIDC_ISSUER=https://forgejo.DOMAIN.TLD # Correct OIDC_ISSUER=https://forgejo.DOMAIN.TLD/ ``` The following error probably occurred internally. ``` [server] warn: Error while exchanging OIDC code: RPError: iss mismatch, expected https://forgejo.DOMAIN.TLD/, got: https://forgejo.DOMAIN.TLD/.well-known/openid-configuration ```
Author
Owner

@zyppe commented on GitHub (Jul 8, 2024):

I just set OIDC_ISSUER to my domain(end with /)
and OIDC_SCOPES=openid email profile
Of course, I have set OIDC_CLIENT_ID, OIDC_CLIENT_SECRET.
It just tell me unknown error.

@zyppe commented on GitHub (Jul 8, 2024): I just set OIDC_ISSUER to my domain(end with /) and OIDC_SCOPES=openid email profile Of course, I have set OIDC_CLIENT_ID, OIDC_CLIENT_SECRET. It just tell me unknown error.
Author
Owner

@eternity1984 commented on GitHub (Jul 8, 2024):

Umm...
What did you use to start Planka in your environment?
...docker-compose or helm? please show me your configuration file.

If you run the $ npm start command to start the develop environment for the first time, you may have forgotten to initialize the database. Please run the following command:
$ npm run server:db:init

@eternity1984 commented on GitHub (Jul 8, 2024): Umm... What did you use to start Planka in your environment? ...docker-compose or helm? please show me your configuration file. If you run the `$ npm start` command to start the develop environment for the first time, you may have forgotten to initialize the database. Please run the following command: `$ npm run server:db:init`
Author
Owner

@zyppe commented on GitHub (Jul 11, 2024):

Sorry that I dropped to use planka. Still thanks for your help!

@zyppe commented on GitHub (Jul 11, 2024): Sorry that I dropped to use planka. Still thanks for your help!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#509