我在使用Meteor.accounts和MS Azure进行SAML登录。我将此https://github.com/steffow/meteor-accounts-saml库用于SAML,该库源自https://github.com/bergie/passport-saml
程序如下:
所以现在我想获得进一步处理的SAML令牌(或者至少是关于meteor从IDP获取的登录用户的信息)。
由于我不知道Meteor存储SAML令牌或者可以在代码中获取SAML令牌,有人可以帮助我获取SAML响应吗?
答案 0 :(得分:2)
现在可能已经解决但是在这里...... 根据代码,在" saml_server.js"中检索saml响应。在第70行,令牌也应该在那里(loginRequest.credentialToken) loginResult应该很容易保存到Meteor.users集合中
var loginResult = Accounts.saml.retrieveCredential(loginRequest.credentialToken);
var email = loginResult.profile.email;
var user = Meteor.users.findOne({username: email});
if (!user) {
Accounts.createUser({
"username": email,
"profile": StufffromloginResult
});
} else {
Meteor.users.update(
{
"username": email
},
{ "$set": {
"profile": StufffromloginResult,
}
});
}
并检索:
Meteor.user().profile