oidc-react icon indicating copy to clipboard operation
oidc-react copied to clipboard

[Feature Request]: Add 'metadata' to the available parameters.

Open innesian opened this issue 4 years ago • 1 comments

I'm trying to work with the Slack Open ID and have run into an issue; they're not serving the proper CORS headers on their discovery endpoint https://slack.com/.well-known/openid-configuration

The project that this library is a wrapper for makes an alternative available with the metadata parameter but it doesn't seem to be supported yet. I added it and am making a pull request, contribution notes mentioned opening a ticket first!

One note, you'll still need to send an authority value over. This configuration for Slack is now working for me after the change.

  onSignIn: async (user) => {
    alert('You just signed in, congratz! Check out the console!');
    console.log(user);
    window.location.hash = '';
  },
  authority: 'https://slack.com',
  metadata: {
    issuer: 'https://slack.com',
    authorization_endpoint: "https://slack.com/openid/connect/authorize",
    token_endpoint: "https://slack.com/api/openid.connect.token",
    userinfo_endpoint: "https://slack.com/api/openid.connect.userInfo",
    jwks_uri: "https://slack.com/openid/connect/keys",
  },
  clientId: process.env.REACT_APP_SLACK_CLIENT_ID,
  responseType: 'code',
  redirectUri:
    process.env.NODE_ENV === 'development'
      ? 'https://localhost:3000/slack/authenticate'
      : 'https://localhost:3000/slack/authenticate',
};


innesian avatar Sep 01 '21 01:09 innesian

Pull request opened here https://github.com/bjerkio/oidc-react/pull/715

innesian avatar Sep 01 '21 02:09 innesian