Allowedconnections

the following code fails and displays: “Something went wrong. Please contact technical support.” to because of the allowedConnections option. if i delete the allowedConnections, it works fine.

Any idea what i am doing wrong here?

import { setSecret } from ‘./auth’
import uuid from ‘uuid’
const getLock = (options) => {
const config = require(‘…/config.json’)
const Auth0Lock = require(‘auth0-lock’).default
return new Auth0Lock(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_DOMAIN, options)
}

const getBaseUrl = () => ${window.location.protocol}//${window.location.host}

const getOptions = (container) => {
const secret = uuid.v4()
setSecret(secret)
return {
container,
closable: false,
allowedConnections: [“twitter”, “facebook”],
auth: {
responseType: ‘token id_token’,
redirectUrl: ${getBaseUrl()}/auth/signed-in,
params: {
scope: ‘openid profile email’,
state: secret,
}
}
}
}

export const show = (container) => getLock(getOptions(container)).show()
export const logout = () => getLock().logout({ returnTo: getBaseUrl() })

:wave: @thierry1 is this your first time setting up your application with Auth0? What type of application do you have? Have you setup the connections (Twitter and Facebook in this case) with developer keys? (Example for Twitter: https://auth0.com/docs/connections/social/twitter#2-get-your-consumer-key-and-consumer-secret) Can you check your Chrome console? If that’s the case you’ll see a message like At least one database, enterprise or social connection needs to be available. If not, can you let me know what you find?

@kimcodes thank you, this was actually quite simple, i had to ‘activate’ the allowedConnections on the Auth0 portal itself before using it in my code. Once i did that it worked fine.

and… yes this was my first time setting up my app with Auth0.

Thanks again for your help

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.