luisfrocha
luisfrocha
NNuxt
Created by luisfrocha on 4/24/2025 in #❓・help
Problems setting up nuxt-auth-utils using custom provider
I'm having issues with this today. I followed @Atinux 's suggestion, and it seems to "want" to work, but it's creating excessive redirects, and on the Nuxt server logs it shows that it cannot find the env variables (even though I've added them), and it also logs that the callback url does not exist (even though I added it to /server/api/auth/custom-provider). I created the files in the suggestion, and they seem to be getting used, but my guess is that something is not configured correctly in nuxt.conf.ts In oauth key I have the following
{
['custom-provider']: {
authorizationParams: {
response_type: 'code',
scope: 'profile email',
},
authorizationUrl: `${process.env.OAUTH_BASE}/oauth/authorize`,
baseURL: process.env.AUTH_ORIGIN,
clientId: config.clientId,
clientSecret: config.clientSecret,
redirectURL: `${process.env.AUTH_ORIGIN}/api/auth/custom-provider`,
scope: ['profile', 'email'],
tokenUrl: `${process.env.OAUTH_BASE}/oauth/token`,
},
}
{
['custom-provider']: {
authorizationParams: {
response_type: 'code',
scope: 'profile email',
},
authorizationUrl: `${process.env.OAUTH_BASE}/oauth/authorize`,
baseURL: process.env.AUTH_ORIGIN,
clientId: config.clientId,
clientSecret: config.clientSecret,
redirectURL: `${process.env.AUTH_ORIGIN}/api/auth/custom-provider`,
scope: ['profile', 'email'],
tokenUrl: `${process.env.OAUTH_BASE}/oauth/token`,
},
}
So either something is not configured correctly, or the code in the custom files is incorrect somewhere. Any suggestions on how it needs to be set up to get it working? Does anyone have it working with a custom oauth provider (NOT the out-of-the-box ones listed in the documentation page) and would be able to share sample code?
6 replies