yasudacloud / strapi-plugin-sso

MIT License
89 stars 61 forks source link

Issue with JumpCloud #41

Open yunylz opened 11 months ago

yunylz commented 11 months ago

When setup with JumpCloud OIDC, after login this issue occurs:

Authentication failed

Cannot read properties of undefined (reading 'toLocaleLowerCase')

This is my conf:


module.exports = ({env}) => ({
    'strapi-plugin-sso': {
      enabled: true,
      config: {
        // OpenID Connect
        OIDC_REDIRECT_URI: 'https://stream-mgmt.danceparty.lol/strapi-plugin-sso/oidc/callback',
        OIDC_CLIENT_ID: ****',     
        OIDC_CLIENT_SECRET: '****',

        OIDC_SCOPES: 'openid profile email', // https://oauth.net/2/scope/
        // API Endpoints required for OIDC
        OIDC_AUTHORIZATION_ENDPOINT: 'https://oauth.id.jumpcloud.com/oauth2/auth', 
        OIDC_TOKEN_ENDPOINT: 'https://oauth.id.jumpcloud.com/oauth2/token',
        OIDC_USER_INFO_ENDPOINT: 'https://oauth.id.jumpcloud.com/userinfo',
        OIDC_USER_INFO_ENDPOINT_WITH_AUTH_HEADER: false,
        OIDC_GRANT_TYPE: 'authorization_code', // https://oauth.net/2/grant-types/
        // customizable username arguments
        OIDC_FAMILY_NAME_FIELD: 'family_name',
        OIDC_GIVEN_NAME_FIELD: 'given_name',
      }
    }
  })

And result from PM2:

5|stream-m | [2023-12-29 14:57:28.634] http: GET /strapi-plugin-sso/oidc (2 ms) 302
5|stream-m | [2023-12-29 14:57:32.435] http: GET /strapi-plugin-sso/oidc/callback?code=kIJmVyZxt5x3gXHNeaqaSN************&scope=openid+profile+email&state=undefined (943 ms) 200
Screenshot 2023-12-29 16 59 09
yasudacloud commented 10 months ago

@chaeyan Sorry for the delay. There is probably an error in converting your email address to lower case. In other words, I expect that the response after authentication does not include the email. Is it possible to add the email in the provider's settings?