angularjs - okta登录成功但重定向页面在angularjs中不起作用
问题描述
获得 Okta api 成功但在此成功函数内部重定向它不起作用,警报也不起作用。请让我知道我的错误在哪里?
var oktaSignIn = new OktaSignIn({
authParams: {
responseType: 'id_token',
responseMode: 'okta_post_message',
scopes: ['openid', 'groups'],
// data : JSON.stringify(data1)
},
clientId: OKTA_CLIENT_ID,
baseUrl: OKTA_ORG_URL,
//redirectUri: "http://localhost:8080",
});
oktaSignIn.renderEl(
{ el: '#okta-login-container' },
function (res) {
if (res.status == 'SUCCESS') {
alert("User successfully authenticated");
console.log(res);
//$window.location.href = 'main.jsp';
/* if (res.claims.groups.includes('Example')) {
console.log("User in 'Example' group");
// Uncomment the line below to redirect to example.com
// window.location = "http://www.example.com";
}*/
}
}
);
解决方案
推荐阅读
- mongodb - 使用 geoWithin 的 MongoDB 查询工作错误
- c# - .net 5 中的记录类型用法是什么?
- css - 如何防止网格区域的内部内容向下突出?
- python - 使用自然三次样条外推时的曲率
- excel - EXCEL:两栏,2轴直方图
- python - 给定系列列表时,熊猫“未正确调用DataFrame构造函数”
- windows - 达到一定计数值后自动删除子文件夹中的文件
- ruby - 用空格分割的 Ruby 字符串作为输入删除的不仅仅是空格
- microsoft-graph-api - 我们可以使用自定义团队模板来请求新的团队团队吗(失败)
- php - 如何从对象数组中删除私有属性?