Azure app registration and Gitea OAuth2 - "issuer" property of .well-known/openid-configuration doesn't work for "common" or "organizations", but works for "consumers"
My server setup: Gitea 1.11.6 running on Arch Linux. I'm using Microsoft's OAuth2 service as an authentication provider. If I use the common endpoint, Gitea throws a 500 error and logs the following:
routers/user/auth.go:601:handleOAuth2SignIn() [E] UserSignIn: oauth2: error validating JWT token: issuer in token does not match issuer in OpenIDConfig discovery
If I use the consumers endpoint, everything immediately works as expected, and Gitea allows me to create an account (or link an existing one) with my Microsoft account as the authentication provider.
I noticed in the actual openid-configuration response from Microsoft, the "common" and "organizations" endpoints both have "{tenant}" in the string value for "issuer", whereas "consumers" returns a GUID.
"issuer": "https://login.microsoftonline.com/{tenantid}/v2.0",
"issuer": "https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",
It seems like maybe something's wrong with the "issuer" property in the common endpoint response. I'm not sure why else Gitea would be throwing a token issuer mismatch error.