[Feat] Adding OIDC OAuth callback support #780

Closed
opened 2026-02-04 21:19:14 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @luisgreen on GitHub (Aug 7, 2025).

Is this a feature for the backend or frontend?

Backend

What would you like?

When the user is registered add the oauth callback suppport

      if (sails.config.custom.oidcUseOauthCallBack) {
        tokenSet = await client.oauthCallback(
          sails.config.custom.oidcRedirectUri,
          {
            iss: sails.config.custom.oidcIssuer,
            code: inputs.code,
          },
          {
            nonce: inputs.nonce,
          },
        );
      } else {
        tokenSet = await client.callback(
          sails.config.custom.oidcRedirectUri,
          {
            iss: sails.config.custom.oidcIssuer,
            code: inputs.code,
          },
          {
            nonce: inputs.nonce,
          },
        );
      }

This is still not a complete solution but enables the authentication.

You need to set a custom location in a reverse proxy like this so the discovery can work avoiding adding more environment variables.

location = /.well-known/openid-configuration {
    default_type application/json;
    return 200 '{
  "issuer": "https://<YOUR_URL>",
  "authorization_endpoint": "https://<YOUR_URL>/oauth/authorize",
  "token_endpoint": "https://<YOUR_URL>/oauth/access_token",
  "revocation_endpoint": "https://<YOUR_URL>/oauth/revoke",
  "userinfo_endpoint": "https://<YOUR_URL>/api/v4/users/me",
  "scopes_supported": ["openid", "profile", "email"],
  "response_types_supported": ["code"],
  "grant_types_supported": ["authorization_code"],
  "token_endpoint_auth_methods_supported": ["client_secret_post"],
  "claims_supported": ["name", "preferred_username", "email", "profile"]
}';
}

Why is this needed?

I have been using mattermost for a while and I would love to have this feature in code so i can oidc login with Mattermost

Other information

I think this also solves https://github.com/plankanban/planka/issues/593 and https://github.com/plankanban/planka/issues/690

Originally created by @luisgreen on GitHub (Aug 7, 2025). ### Is this a feature for the backend or frontend? Backend ### What would you like? When the user is registered add the oauth callback suppport ``` if (sails.config.custom.oidcUseOauthCallBack) { tokenSet = await client.oauthCallback( sails.config.custom.oidcRedirectUri, { iss: sails.config.custom.oidcIssuer, code: inputs.code, }, { nonce: inputs.nonce, }, ); } else { tokenSet = await client.callback( sails.config.custom.oidcRedirectUri, { iss: sails.config.custom.oidcIssuer, code: inputs.code, }, { nonce: inputs.nonce, }, ); } ``` This is still not a complete solution but enables the authentication. You need to set a custom location in a reverse proxy like this so the discovery can work avoiding adding more environment variables. ``` location = /.well-known/openid-configuration { default_type application/json; return 200 '{ "issuer": "https://<YOUR_URL>", "authorization_endpoint": "https://<YOUR_URL>/oauth/authorize", "token_endpoint": "https://<YOUR_URL>/oauth/access_token", "revocation_endpoint": "https://<YOUR_URL>/oauth/revoke", "userinfo_endpoint": "https://<YOUR_URL>/api/v4/users/me", "scopes_supported": ["openid", "profile", "email"], "response_types_supported": ["code"], "grant_types_supported": ["authorization_code"], "token_endpoint_auth_methods_supported": ["client_secret_post"], "claims_supported": ["name", "preferred_username", "email", "profile"] }'; } ``` ### Why is this needed? I have been using mattermost for a while and I would love to have this feature in code so i can oidc login with Mattermost ### Other information I think this also solves https://github.com/plankanban/planka/issues/593 and https://github.com/plankanban/planka/issues/690
Author
Owner

@luisgreen commented on GitHub (Aug 7, 2025):

@meltyshev @nickbe @daniel-hiller

@luisgreen commented on GitHub (Aug 7, 2025): @meltyshev @nickbe @daniel-hiller
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#780