Using Gitea as oauth2 provider for Portainer

Hello everyone,
I need some help with configuring Gitea as an OAuth2 provider for Portainer. I have followed the steps listed below:

  1. Installed and configured Gitea on my server using docker
  2. Configured Portainer to use custom OAuth provider
  3. Created an OAuth2 application in Gitea with the correct redirect URI for Portainer
  4. Entered the client ID and client secret from Gitea into the Portainer settings

However, when I try to log in to Portainer using my Gitea credentials, I get an error message saying “Failure Unauthorized” and “Unable to login via OAuth”. I also see an error 500 in the browser console with the message “{data: {message: "Unable to authenticate through OAuth", details: "Unauthorized"}, status: 500, headers: function, config: Object, statusText: "", …}”.

I’m not sure what I’m doing wrong, but I suspect that there might be an issue with the way I’ve configured the OAuth2 application in Gitea or the Portainer settings.

If anyone has experience with configuring Gitea as an OAuth2 provider for Portainer and has encountered this issue before, I would greatly appreciate any advice or guidance you can offer.
Thank you in advance for your help!

Try it like this:


Fixed it, I had a self-signed certificate, and it needed to be mounted like /opt/my-ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt and it has to be .crt. It also helped to add command: --log-level=DEBUG to Portainer’s docker compose.

1 Like

Thank you, that helped too. :grinning: