加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

AngularJS Google Oauth 400错误redirect_uri的参数值无效:不允

发布时间:2020-12-17 06:47:13 所属栏目:安全 来源:网络整理
导读:我正在使用Kinvey在我的AngularJS应用程序上处理Oauth,它适用于Facebook,但是当我尝试使用Google登录时,我收到400错误: 错误:invalid_request redirect_uri的参数值无效:不允许使用片段:localhost:9000 /#/ login 有没有人遇到过Google Oauth和Angular
我正在使用Kinvey在我的AngularJS应用程序上处理Oauth,它适用于Facebook,但是当我尝试使用Google登录时,我收到400错误:

错误:invalid_request

redirect_uri的参数值无效:不允许使用片段:localhost:9000 /#/ login

有没有人遇到过Google Oauth和Angular这个问题?关于如何绕过它的任何想法?该问题源于Angular路由的URL中的哈希值.

解决方法

#被称为片段标识符.错误片段不允许:表示您必须将#替换为替代,例如:

> localhost:9000 / route / login

然后与Kinvey重定向:

req.request({uri: 'http://localhost:9000/route/login',method: 'GET'},function(error,response,body){
  response.statusCode = 302; 
  response.setHeader("Location","/#/login");
  response.end();
  }
);

以下是一些与类似问题无关的问题:

> Redirect to different page url in Node.js (Not in express or other frameworks)
> Redirecting client with NodeJS and Restify
> URI encoding in Yahoo mail compose link
> URL fragment missing from redirect URI
> Why URI-encoded (‘#’) anchors cause 404,and how to deal with it in JS?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读