如何在 Nuxt.js 上使用自定义域设置 Auth0
How to setup Auth0 with custom domain on Nuxt.js
我已经让 Auth0 与我的 Nuxt.js 应用程序一起使用,但现在我正尝试将其与自定义域一起使用。
我已经设置好所有内容并在 Auth0 端使用自定义域。
我试图只更改 nuxt.config.js 上的域:
auth: {
redirect: {
login: '/auth/login',
callback: '/auth/signed-in'
},
fullPathRedirect: true,
strategies: {
local: false,
auth0: {
domain: 'customlogin.com',
client_id: '------'
}
}
}
但是当我尝试登录时,我从 Auth0 收到此错误:
You should not be hitting this endpoint. Make sure to use the code
snippets shown in the tutorial or visit support.auth0.com for help.
Auth0 还提到将此添加到配置中:
overrides: {
__tenant: config.auth0Tenant,
__token_issuer: config.authorizationServer.issuer
},
但我不确定我可以在 NuxtJS 的什么地方添加它。
好的,找到问题了。
由于我在 Auth0 设置上使用自定义登录页面,因此我必须将上面的附加设置添加到那里:
/* additional configuration needed for custom domains */
configurationBaseUrl: config.clientConfigurationBaseUrl,
overrides: {
__tenant: config.auth0Tenant,
__token_issuer: 'custom.domain.com'
},
我已经让 Auth0 与我的 Nuxt.js 应用程序一起使用,但现在我正尝试将其与自定义域一起使用。
我已经设置好所有内容并在 Auth0 端使用自定义域。
我试图只更改 nuxt.config.js 上的域:
auth: {
redirect: {
login: '/auth/login',
callback: '/auth/signed-in'
},
fullPathRedirect: true,
strategies: {
local: false,
auth0: {
domain: 'customlogin.com',
client_id: '------'
}
}
}
但是当我尝试登录时,我从 Auth0 收到此错误:
You should not be hitting this endpoint. Make sure to use the code snippets shown in the tutorial or visit support.auth0.com for help.
Auth0 还提到将此添加到配置中:
overrides: {
__tenant: config.auth0Tenant,
__token_issuer: config.authorizationServer.issuer
},
但我不确定我可以在 NuxtJS 的什么地方添加它。
好的,找到问题了。 由于我在 Auth0 设置上使用自定义登录页面,因此我必须将上面的附加设置添加到那里:
/* additional configuration needed for custom domains */
configurationBaseUrl: config.clientConfigurationBaseUrl,
overrides: {
__tenant: config.auth0Tenant,
__token_issuer: 'custom.domain.com'
},