wp as oauth server

使用插件:oauth server

参考链接:https://juejin.cn/post/6992480167050346532

文档:https://wp-oauth.com/docs/general/grant-types/authorization-code/

关键点:

                var loginResponse = await axios.get("https://yafeya-ncs.japaneast.cloudapp.azure.com/oauth/me", {
                    headers: {
                        "Authorization": auth_token
                    }
                });

                if (loginResponse.status == 200) {
                    var user = loginResponse.data.user_login;
                    var email = loginResponse.data.user_email;
                    var roles = loginResponse.data.user_roles;


评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注