微信身份登陆到多个域名应用的方案

- 域名 A (fe-apollo-pre-staging.bulletelc.com)
- 域名 B (eshop-apollo-pre-staging.bulletelc.com)

其中A系微信公众平台网页授权域名,因微信公众号只有一个认证授权域名(fe-apollo-pre-staging.bulletelc.com)需研究如何跳转到eshop域名,仍能保持有微信用户身份或类似session保持。

 

方案:
设 域名A 为微信公众号授权站点, 域名B为应用站点,B通过合法api发出认证请求,returnUrl带参数返回给A, 微信认证后再通过“r"路由参数返回给B的认证登陆方法

http://fe-apollo-pre-staging.bulletelc.com/authorize/wechat-agent?r=http://eshop-apollo-pre-staging.bulletelc.com/authorize/wechat'

B站main.php 设置:
'wechat' => [
            'class' => 'common\components\Wechat\Wechat',
            'agentReturnUrl' =>'http://fe-apollo-pre-staging.bulletelc.com/authorize/wechat-agent?r=http://eshop-apollo-pre-staging.bulletelc.com/authorize/wechat',
        // 'userOptions' => [] # user identity class params
        // 'sessionParam' => # wechat user info will be stored in session under this key
        // 'returnUrlParam' => 
# returnUrl param stored in session
        ],

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

bennybi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值