javascript - 使用 AngulrJs 和 Angular Ui 路由器从 IdentityServer3 重定向时出现错误响应

标签 javascript angularjs redirect angular-ui-router identityserver3

我正在创建一个用于 IdentityServer 3 的测试应用程序,并使用 AngularJs、Angular Ui Router 和 oauth-ng 库来创建它。我的应用程序需要在客户端使用 OpenID 连接授权代码流。所以我对 oauth-ng 库做了相当小的更改。

我的测试应用程序成功连接到 IdentityServer3 并获取身份验证代码和状态。但是当服务器重定向到重定向 url 时,我收到 404 错误。以下消息

enter image description here

但是 URL 中包含授权代码和状态。这是我编写的一些代码。

login.html - 登录 View

<oauth
    site="https://localhost:44333/core"
    client-id="codeclient"
    response-type="code" // <= added this attribute
    redirect-uri="http://localhost:4443/redirect"
    scope="openid profile email">
</oauth>

IdentityServer 中的重定向 URL 已正确配置。以下是IdentityServer3返回的url

https://localhost:4443/redirect?code=5d5170f227fd2b90a8d87bdae0588baa&session_state=tWVYj9OnDPYzaN1GmDTsgmdXYMk2AfX5R8JsHEsWZ5Q.cfa44973eb00d05b306b6bc2e286c22e

但是出现了上面的错误。 Firefox 浏览器在控制台上出现错误,指出 Mixtype Error,建议我从 HTTP 切换到 HTTPS。我也尝试过以下 python script但这也不起作用。有人可以帮忙吗?

最佳答案

您必须设置正确的授权路径。检查我的设置

<oauth
site="https://localhost:44333"
client-id="angular-client-id"
redirect-uri="http://localhost:9000"
authorize-path="/connect/authorize"
response-type="id_token token"
nonce="value"
scope="openid profile {your resource scope}" style="width: 50%">

关于javascript - 使用 AngulrJs 和 Angular Ui 路由器从 IdentityServer3 重定向时出现错误响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29813707/

相关文章:

javascript - 如何查找动态创建的html表格行中某个单词出现的次数

c# - 使用 Razor MVC3 的发送者-接收者

Angularjs ng-attr-title 在 Chrome 浏览器中不起作用

javascript - AngularJS - 使用 md5 密码检查登录服务中的用户/密码

ruby-on-rails - 将事件管理员登录重定向到设计登录

javascript - 在脚本中重定向

c - 在 dup2 之后,stream 仍然包含旧内容?

javascript - 在 iframe 中更改页面的按钮或链接

angularjs - 在 Spring Web 项目中集成 Angular JS 导致将项目永远发布到 Tomcat

javascript - 我将如何在 coffeescript 中编写这个 jQuery?