Ember 应用程序正在使用 adfs 登录。 当成功登录时,adfs 将使用路由和查询参数重定向到 ember Web 应用程序。这些查询参数包含
access_token
refresh_token
user_id
scope
我需要使用这些凭证数据更新 ember 身份验证的 session 。我怎样才能实现这个目标?
最佳答案
您需要使用您的参数来验证
session 。
为了能够验证您的 session ,您需要创建一个验证器。基本上,这将为您提供一些能够处理 session 的方法(invalidateSession
、authenticate
、restoreSession
等)。
对于身份验证器创建,请查看 http://ember-simple-auth.com/api/classes/BaseAuthenticator.html
它看起来像这样 https://jsfiddle.net/e7nzoa6y/ 但这并不是排他性的,您必须使用端点和其他内容对其进行自定义
一旦您拥有了身份验证器,请查看以下位置的文档: http://ember-simple-auth.com/api/classes/BaseAuthenticator.html
在您的 Controller 中,注入(inject) session
服务后,
您将能够使用类似于
this.session.authenticate(
'authenticator:YOUR_AUTHENTICATOR', queryParams
);
关于ember.js - Ember 简单例份验证如何在身份验证数据可用时进行更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53061210/