首页 > 解决方案 > 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";
                }*/
            }
        }
    );

标签: angularjsokta-api

解决方案


推荐阅读