Spotify API重定向URI具有更改的参数?

发布于 2025-01-23 10:57:51 字数 248 浏览 3 评论 0原文

我目前正在使用Spotify API。身份验证的请求URL为http:// localhost:8080/app/9 9是用户相应ID的参数。

回调URL也在Spotif开发人员中输入: http:// localhost:8080/app/?

我现在收到错误消息: Invalid_client:无效重定向URI,

我知道这是由于更改的Callbackuri所致。现在的问题。如何为URI中的参数创建通配符?

感谢您的帮助。

I am currently using the Spotify APi. The request URL from which the authentication originates is http://localhost:8080/app/9
The 9 is the parameter for the respective ID of the user.

The callback URL is also entered in Spotif Developer:
http://localhost:8080/app/?

I now get the error message:
INVALID_CLIENT: Invalid redirect URI

I am aware that this is due to the changed CallbackURi. The question now. How do I create a wildcard for the parameter in the URI?

Thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿港小镇 2025-01-30 10:57:51

缺乏理解使我认为必须将用户ID包含在回调URI中。但是,这不仅是一个安全问题,而且由于回调URI必须是静态的,因此它也无效。

因此,我决定解决会话cookie的问题。现在,当用户在登录后首次输入页面时,我保存一个带有会话ID和用户ID的cookie。

如果用户在OAuth2身份验证后返回站点,我会使用缓存的会话cookie。

Lack of understanding made me think that the userID must be included in the callback URI. However, this would not only be a security issue, but it also doesn't work because the callback URI has to be static.

So I decided to solve the problem with session cookies. Now i save a cookie with a session id and the userID when the user first enters the page after logging in.

If the user comes back to the site after the oAuth2 authentication, I use the session cookie that is cached.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文