Closed TinMiracle closed 1 week ago
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
📦 Environment
Docker
v1.15.23
Ubuntu
Chrome
I used Logto Cloud for deployment, and the deployment was successful. After successfully logging into Lobe, I jumped directly to the error page as follows:
The Logto I deployed myself also has the same problem.
If I switch to Auth0, there will be no problems and I can log in and jump normally.
The following is the code for Logto Cloud in my .env
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=logto
LOGTO_CLIENT_ID=lo8du4jwh7d70zasr53ss
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
LOGTO_ISSUER=https://zo0dnb.logto.app/oidc
NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
The following is the Logto account password used for testing
Email address: test@example.com
Username: test
Password: 1lVHHK7k
The following is the docker log:
[31m[auth][error] [0m CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror
[31m[auth][cause] [0m: TypeError: "client.client_secret" property must be a non-empty string
at nc (/app/.next/server/chunks/76974.js:357:9466)
at nd (/app/.next/server/chunks/76974.js:357:10182)
at nA (/app/.next/server/chunks/76974.js:357:13737)
at nS (/app/.next/server/chunks/76974.js:357:14183)
at n$ (/app/.next/server/chunks/76974.js:357:17211)
at n0 (/app/.next/server/chunks/76974.js:357:27072)
at async ir (/app/.next/server/chunks/76974.js:357:34046)
at async ip (/app/.next/server/chunks/76974.js:357:45375)
at async im (/app/.next/server/chunks/76974.js:357:49748)
at async /app/node_modules/.pnpm/next@14.2.8_@babel+core@7.23.6_supports-color@8.1.1__@opentelemetry+api@1.9.0_react-dom@18.3._itjmu72s7n7tov6po6nkhcdpya/node_modules/next/dist/ compiled/next-server/app-route.runtime.prod.js:6:36932
[31m[auth][details] [0m: {
"provider": "logto"
}
[NextAuth] Error: {
cause: 'Configuration',
message: 'Wrong configuration, make sure you have the correct environment variables set. Visit https://lobehub.com/docs/self-hosting/advanced/authentication for more details.',
name: 'NextAuth Error'
}
Could you please tell me how to solve this problem in Logto.
No response
No response
No response
👀 @TinMiracle
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
Hello @TinMiracle! I'm here to help you with your technical issues. Let's work together to solve the problem you're facing.
I found a similar closed issue that might help you resolve the Logto authentication error:
Issue: logto登录提示HTTPS错误[Bug] - Closed
Crypto.subtle
API is only available in secure contexts (HTTPS). You can configure HTTPS for your local deployment using self-signed certificates and Nginx as a reverse proxy [1].Discussion: logto登录提示HTTPS错误[Bug] - Solved
--ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://192.168.31.11:3002
[2].For your specific issue, it seems like there is a typo in your environment variables. The variable LOGTO_CLIENT_SECRETT
should be LOGTO_CLIENT_SECRET
. Here is the corrected .env
configuration:
KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=logto
LOGTO_CLIENT_ID=lo8du4jwh7d70zasr53ss
LOGTO_CLIENT_SECRET=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
LOGTO_ISSUER=https://zo0dnb.logto.app/oidc
NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
Ensure that these variables are correctly set in your LobeChat environment. After updating the .env
file, restart your Docker services to apply the changes:
docker compose up -d
Do not use docker compose restart lobe
to restart, as this method will not reload the environment variables, and your configuration changes will not take effect [3][4].
To continue talking to Dosu, mention @dosu.
我和你正好相反,logto没问题,auth0提示环境变量错误。。你auth0是如何设置的能发一下吗? 关于logto,本地部署的话会因为证书问题无法正常访问,需要新建一个浏览器快捷方式(chrome浏览器),然后在快捷方式上右键属性,在目标后边加上这句:--ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://你的ip:3002,用这个快捷方式访问即可,不过这样只能本地访问。如果需要外网访问,需要将你的域名反代,监听443端口,logto只支持https
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I am exactly the opposite of you. Logto is fine, but auth0 prompts an environment variable error. . Can you tell me how you set up auth0? Regarding logto, if it is deployed locally, it will not be accessible due to certificate issues. You need to create a new browser shortcut (chrome browser), then right-click the properties of the shortcut and add this sentence after the target: --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://your ip:3002, use this shortcut to access, but this can only be accessed locally. If you need external network access, you need to reverse your domain name and listen to port 443. Logto only supports https.
我和你正好相反,logto没问题,auth0提示环境变量错误。。你auth0是如何设置的能发一下吗? 关于logto,本地部署的话会因为证书问题无法正常访问,需要新建一个浏览器快捷方式(chrome浏览器),然后在快捷方式上右键属性,在目标后边加上这句:--ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://你的ip:3002,用这个快捷方式访问即可,不过这样只能本地访问。如果需要外网访问,需要将你的域名反代,监听443端口,logto只支持https
我用的是Logto Cloud部署的,所以应该不存在https的问题。 这是我的auth0设置
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=auth0
AUTH0_CLIENT_ID=VWpqWERQPkyD5AsmABpEfryPxckcyodM
AUTH0_CLIENT_SECRET=0PmZJYEy1ZQxz2SBoqd0J2i8Wn2rou9Vzco2hkPgP4fsGjD6BtHSoqMQ7uFNzpsR
AUTH0_ISSUER=https://dev-whjbzqs0m7slkv0q.us.auth0.com
ACCESS_CODE=232323232323
NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I am exactly the opposite of you. Logto is fine, but auth0 prompts an environment variable error. . Can you tell me how you set up auth0? Regarding logto, if it is deployed locally, it will not be accessible due to certificate issues. You need to create a new browser shortcut (chrome browser), then right-click the properties of the shortcut and add this sentence after the target: --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=[http://your ip:3002, use this shortcut to access, but this can only be accessed locally. If you need external network access, you need to reverse your domain name and listen to port 443. Logto only supports https](http://%E4%BD%A0%E7%9A%84ip:3002%EF%BC%8C%E7 %94%A8%E8%BF%99%E4%B8%AA%E5%BF%AB%E6%8D%B7%E6%96%B9%E5%BC%8F%E8%AE%BF%E9%97 %AE%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%B8%8D%E8%BF%87%E8%BF%99%E6%A0%B7%E5%8F%AA %E8%83%BD%E6%9C%AC%E5%9C%B0%E8%AE%BF%E9%97%AE%E3%80%82%E5%A6%82%E6%9E%9C%E9 %9C%80%E8%A6%81%E5%A4%96%E7%BD%91%E8%AE%BF%E9%97%AE%EF%BC%8C%E9%9C%80%E8%A6 %81%E5%B0%86%E4%BD%A0%E7%9A%84%E5%9F%9F%E5%90%8D%E5%8F%8D%E4%BB%A3%EF%BC%8C %E7%9B%91%E5%90%AC443%E7%AB%AF%E5%8F%A3%EF%BC%8Clogto%E5%8F%AA%E6%94%AF%E6%8C%81https)
I am using Logto Cloud deployment, so there should be no https problem. This is my auth0 settings
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
NEXT_AUTH_SSO_PROVIDERS=auth0
AUTH0_CLIENT_ID=VWpqWERQPkyD5AsmABpEfryPxckcyodM
AUTH0_CLIENT_SECRET=0PmZJYEy1ZQxz2SBoqd0J2i8Wn2rou9Vzco2hkPgP4fsGjD6BtHSoqMQ7uFNzpsR
AUTH0_ISSUER=https://dev-whjbzqs0m7slkv0q.us.auth0.com
ACCESS_CODE=232323232323
NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle 多了个 T ?
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle An extra T?
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle 多了个 T ?
还真是。。。尴尬了 感谢大神!
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle has an extra T?
It's true. . . Embarrassing. Thank you God!
✅ @TinMiracle
This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle 多了个 T ?
文档这里有一点拼写问题,我也是直接复制过来的,也报错了,然后搜到了这个Iusse
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
LOGTO_CLIENT_SECRETT=JuFffZiAU95CktxX2WtAyqOldmC4d2Vq
@TinMiracle has an extra T?
There is a little spelling problem in the document. I copied it directly and reported an error. Then I searched for this Iusse
我和你正好相反,logto没问题,auth0提示环境变量错误。。你auth0是如何设置的能发一下吗? 关于logto,本地部署的话会因为证书问题无法正常访问,需要新建一个浏览器快捷方式(chrome浏览器),然后在快捷方式上右键属性,在目标后边加上这句:--ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=http://你的ip:3002,用这个快捷方式访问即可,不过这样只能本地访问。如果需要外网访问,需要将你的域名反代,监听443端口,logto只支持https
我用的是Logto Cloud部署的,所以应该不存在https的问题。 这是我的auth0设置
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg NEXT_AUTH_SSO_PROVIDERS=auth0 AUTH0_CLIENT_ID=VWpqWERQPkyD5AsmABpEfryPxckcyodM AUTH0_CLIENT_SECRET=0PmZJYEy1ZQxz2SBoqd0J2i8Wn2rou9Vzco2hkPgP4fsGjD6BtHSoqMQ7uFNzpsR AUTH0_ISSUER=https://dev-whjbzqs0m7slkv0q.us.auth0.com ACCESS_CODE=232323232323 NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
感谢。。。我有个变量弄错了,AUTH0_ISSUER
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
I am exactly the opposite of you. Logto is fine, but auth0 prompts an environment variable error. . Can you tell me how you set up auth0? Regarding logto, if it is deployed locally, it will not be accessible due to certificate issues. You need to create a new browser shortcut (chrome browser), then right-click the properties of the shortcut and add this sentence after the target: --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=[http://your ip:3002, use this shortcut to access, but this can only be accessed locally. If you need external network access, you need to reverse your domain name and listen to port 443. Logto only supports https](http://%E4%BD%A0%E7%9A%84ip:3002%EF%BC%8C%E7 %94%A8%E8%BF%99%E4%B8%AA%E5%BF%AB%E6%8D%B7%E6%96%B9%E5%BC%8F%E8%AE%BF%E9%97 %AE%E5%8D%B3%E5%8F%AF%EF%BC%8C%E4%B8%8D%E8%BF%87%E8%BF%99%E6%A0%B7%E5%8F%AA %E8%83%BD%E6%9C%AC%E5%9C%B0%E8%AE%BF%E9%97%AE%E3%80%82%E5%A6%82%E6%9E%9C%E9 %9C%80%E8%A6%81%E5%A4%96%E7%BD%91%E8%AE%BF%E9%97%AE%EF%BC%8C%E9%9C%80%E8%A6 %81%E5%B0%86%E4%BD%A0%E7%9A%84%E5%9F%9F%E5%90%8D%E5%8F%8D%E4%BB%A3%EF%BC%8C %E7%9B%91%E5%90%AC443%E7%AB%AF%E5%8F%A3%EF%BC%8Clogto%E5%8F%AA%E6%94%AF%E6%8C%81https)
I use Logto Cloud deployment, so there should be no https problem. This is my auth0 settings
NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg NEXT_AUTH_SSO_PROVIDERS=auth0 AUTH0_CLIENT_ID=VWpqWERQPkyD5AsmABpEfryPxckcyodM AUTH0_CLIENT_SECRET=0PmZJYEy1ZQxz2SBoqd0J2i8Wn2rou9Vzco2hkPgP4fsGjD6BtHSoqMQ7uFNzpsR AUTH0_ISSUER=https://dev-whjbzqs0m7slkv0q.us.auth0.com ACCESS_CODE=232323232323 NEXTAUTH_URL=https://lobe.tiegg.com/api/auth
grateful. . . I made a mistake with a variable, AUTH0_ISSUER
📦 Environment
Docker
📌 Version
v1.15.23
💻 Operating System
Ubuntu
🌐 Browser
Chrome
🐛 Bug Description
我使用Logto Cloud 进行部署,部署成功,登录Lobe成功后直接跳转到错误页面如下:
我自己部署的Logto也是有相同的问题。 我换成Auth0的话,就没有任何问题,可以正常登录跳转。 以下是我
.env
中的Logto Cloud的代码以下是测试用的Logto账号密码
以下是docker log:
请问各位大神怎么解决Logto的这个问题。
📷 Recurrence Steps
No response
🚦 Expected Behavior
No response
📝 Additional Information
No response