simon7000
09/20/2023, 1:56 PMsupertokens-node supertokens-auth-react supertokens-web-js. I am trying to add a custom provider. Is clientType for react required? If I provide the clientType I am getting an error that the config for this client type is missing.rp_st
09/20/2023, 2:21 PMrp_st
09/20/2023, 2:22 PMsimon7000
09/20/2023, 2:57 PMproviders: [
            {
              config: {
                thirdPartyId: 'twitter',
                name: 'Twitter',
                authorizationEndpoint: 'https://twitter.com/i/oauth2/authorize',
                tokenEndpoint: 'https://api.twitter.com/2/oauth2/token',
                tokenEndpointBodyParams: {
                  grant_type: 'client_credentials',
                },
                userInfoEndpoint:
                  'https://api.twitter.com/2/users/me?user.fields=profile_image_url,url',
                clients: [
                  {
                    clientId: 'xxx',
                    clientSecret:
                      'xxx',
                  },
                ],
              },
            },
          ],
I also tried to add clientType: 'web-and-android' to this config as well as the frontendConfig but then it's asking for a configuration filerp_st
09/20/2023, 3:01 PMrp_st
09/20/2023, 3:01 PMclients array is more than 1simon7000
09/20/2023, 3:04 PMrp_st
09/20/2023, 3:05 PMsimon7000
09/20/2023, 3:05 PMexport const backendConfig = (): TypeInput => {
  return {
    framework: 'express',
    supertokens: {
      // https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
      connectionURI:
        'xxx',
      apiKey: 'xxx',
    },
    appInfo,
    recipeList: [
      ThirdPartyNode.init({
        signInAndUpFeature: {
          // We have provided you with development keys which you can use for testing.
          // IMPORTANT: Please replace them with your own OAuth keys for production use.
          providers: [
            {
              config: {
                thirdPartyId: 'twitter',
                name: 'Twitter',
                authorizationEndpoint: 'https://twitter.com/i/oauth2/authorize',
                tokenEndpoint: 'https://api.twitter.com/2/oauth2/token',
                tokenEndpointBodyParams: {
                  grant_type: 'client_credentials',
                },
                userInfoEndpoint:
                  'https://api.twitter.com/2/users/me?user.fields=profile_image_url,url',
                clients: [
                  {
                    clientId: 'xxx',
                    clientSecret:
                      'xxx',
                  },
                ],
              },
            },
          ],
        },
      }),
      SessionNode.init(),
    ],
    isInServerlessEnv: true,
  }
}simon7000
09/20/2023, 3:05 PMsimon7000
09/20/2023, 3:06 PMsimon7000
09/20/2023, 3:06 PMrp_st
09/20/2023, 3:06 PMsimon7000
09/20/2023, 3:06 PMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by