https://supertokens.com/ logo
#general
Title
# general
a

anubhav

03/25/2022, 11:06 AM
When I click on continue with Google button it gives me following error. Please help me. recipeImplementation.js:163 GET http://localhost:3001/authorisationurl?thirdPartyId=google 404 (Not Found)
n

nkshah2

03/25/2022, 11:10 AM
@User Can you post the information you pass in
appInfo
for the frontend and backend?
Also what recipes are you using?
a

anubhav

03/25/2022, 11:12 AM
social authentication + email and password authentication
n

nkshah2

03/25/2022, 11:17 AM
@User Moving the conversation here (also note that I deleted your screenshots because they contained your API key in them)
Please post your SuperTokens init config again (stripping the API key)
a

anubhav

03/25/2022, 11:18 AM
Should, I post here ??
n

nkshah2

03/25/2022, 11:18 AM
Yes please
a

anubhav

03/25/2022, 11:20 AM
Frontend : export function getApiDomain() { const apiPort = 3001; const apiUrl = `http://localhost:${apiPort}`; return apiUrl; } export function getWebsiteDomain() { const websitePort = 3000; const websiteUrl = `http://localhost:${websitePort}`; return websiteUrl; } SuperTokens.init({ appInfo: { appName: "Passwordless Authentication", apiDomain : getApiDomain(), websiteDomain : getWebsiteDomain(), apiBasePath: "/", websiteBasePath: "/" }, recipeList: [ ThirdPartyEmailPassword.init({ signInAndUpFeature: { providers: [Github.init(), Google.init(), Apple.init()], }, emailVerificationFeature: { mode: "REQUIRED", }, }), Session.init(), ], });
BacKend : const apiPort = 3001; const apiDomain = `http://localhost:${apiPort}`; const websitePort = 3000; const websiteDomain = `http://localhost:${websitePort}`; supertokens.init({ framework: "express", supertokens: { }, appInfo: { appName: "Passwordless Authentication", apiDomain, websiteDomain, apiBasePath: "/", websiteBasePath: "/" }, recipeList: [ ThirdPartyEmailPassword.init({ providers: [ // 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. Google({ clientId: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com", clientSecret: "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" }), Github({ clientId: "467101b197249757c71f", clientSecret: "e97051221f4b6426e8fe8d51486396703012f5bd" }), Apple({ clientId: "4398792-io.supertokens.example.service", clientSecret: { keyId: "7M48Y4RYDL", privateKey: "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----", teamId: "YWQCXGJRJL", }, }), ], }), Session.init(), ], });
there . . . ????
n

nkshah2

03/25/2022, 11:22 AM
Yes give me a second, in the meantime please edit your message and remove the API key as it is sensitive information
a

anubhav

03/25/2022, 11:25 AM
I have removed connectionURI and apiKey.
rest keys I have used from supertoken docs page
n

nkshah2

03/25/2022, 11:27 AM
Can you share the part of the code that adds the supertokens middleware (as explained in step 4 and 5 here: https://supertokens.com/docs/thirdpartyemailpassword/quick-setup/backend#4-add-the-supertokens-apis--cors-setup)
a

anubhav

03/25/2022, 11:29 AM
app.use( cors({ origin: websiteDomain, allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()], methods: ["GET", "PUT", "POST", "DELETE"], credentials: true, }) ); app.use( helmet({ contentSecurityPolicy: false, }) ); app.use(middleware()); // custom API that requires session verification app.get("/sessioninfo", verifySession(), async (req, res) => { let session = req.session; res.send({ sessionHandle: session.getHandle(), userId: session.getUserId(), accessTokenPayload: session.getAccessTokenPayload(), }); }); app.use(errorHandler()); app.use((err, req, res, next) => { res.status(500).send("Internal error: " + err.message); });
n

nkshah2

03/25/2022, 11:29 AM
And just to confirm, your express server is started on port 3001?
a

anubhav

03/25/2022, 11:29 AM
const websitePort = 3000; const websiteDomain = `http://localhost:${websitePort}`;
const apiPort = 3001; const apiDomain = `http://localhost:${apiPort}`;
n

nkshah2

03/25/2022, 11:31 AM
I mean when you call
app.listen
a

anubhav

03/25/2022, 11:32 AM
yes app.listen(apiPort, () => console.log(
API Server listening on port ${apiPort}
)); apiPort is 3001
n

nkshah2

03/25/2022, 11:33 AM
It might be easier to get on a quick call to debug this if you dont mind?
a

anubhav

03/25/2022, 11:34 AM
yeah i don't mind
please tell me how can I connect ??
n

nkshah2

03/25/2022, 11:35 AM
I have DMed you a meet link
Just to summarise, the issue was that the import link for the social providers on the backend was missing
3 Views