【问题标题】:Identity Server 4 Angular Electron App Authentication Example [closed]Identity Server 4 Angular Electron App 身份验证示例 [关闭]
【发布时间】:2018-05-24 21:00:29
【问题描述】:
我正在寻找一个从 Identity Server 4 服务器验证 Angular Electron 应用程序的好例子。
我已经成功使用 oidc-client 通过 Angular Web 应用程序连接到我的身份服务器。
https://github.com/IdentityModel/oidc-client-js
相同的实现不适用于我的 Angular Electron 应用程序,我意识到我应该使用不同的客户端库。
我已经决定将 AppAuthJs 与我的 Angular Electron 应用程序一起使用,但找不到有关如何实现此功能的示例。
救命!
【问题讨论】:
标签:
angular
electron
identityserver4
appauth
【解决方案1】:
This 是 AppAuthJs 库中的一个示例。我记得我们用它作为实现 Electron 应用身份验证的起点。
我还记得在使用您自己的身份服务器实现它时,最好的方法是使用authorization_code 授权类型。您使用示例执行第一个请求(setAuthorizationListener 方法),从响应中获得response code,并使用它以及客户端的所有其他数据(client_id、client_secret 和 @987654327 @) 你创建了access_token 请求,它将引导你进入登录页面。
之后的流程与您的其他 JS 客户端中的流程相同,事实上,在这种情况下,您将拥有一个 refresh token,您可以使用它来更新您的 access token。