一、配置回调地址
- 在Authing应用配置页面,找到登录回调URL,填入回调地址。
- 注意:前提是需将Wordpress通过Authing或者SAML插件,将登录模块接入WP。
二、将code写入localstorage
-
在回调地址的页面,编写以下后台代码:
<script> // 判断当前有无code缓存 const authing_code0 = window.localStorage.getItem("authing_code"); if (authing_code0 === "null") { // 本地无授权码code存储 // 获取回调地址中的code参数 const key = "code"; const temData = new URLSearchParams(window.location.search); const authing_code1 = temData.get(key)