V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
alvy
V2EX  ›  微信

微信公众号授权回调域名可以设置为二级域名吗?

  •  
  •   alvy · 2017-05-03 13:57:42 +08:00 · 20003 次点击
    这是一个创建于 2549 天前的主题,其中的信息可能已经有所发展或是发生改变。

    微信授权登陆,访问认证地址:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx48fedb5806b49a09&redirect_uri=http%3A%2F%2Ftest.abc.com.cn%2Faccount%2Fm_wechat_login%2F1&response_type=code&scope=snsapi_userinfo&connect_redirect=1#wechat_redirect 出现 Oops!something went wrong 错误

    公众号里的授权回调域名设置的是二级域名:例如 test.abc.com.cn

    但是在微信的技术文档离有这么一条:

    2、授权回调域名配置规范为全域名,比如需要网页授权的域名为:www.qq.com,配置以后此域名下面的页面 http://www.qq.com/music.html、http://www.qq.com/login.html 都可以进行 OAuth2.0 鉴权。但 http://pay.qq.comhttp://music.qq.comhttp://qq.com 无法进行 OAuth2.0 鉴权

    所以我怀疑是我设置的回调域名是二级域名导致访问出错

    那么问题来了,是否是因为这个引起的,如何解决这个问题?

    第 1 条附言  ·  2017-05-03 14:54:42 +08:00
    语文是音乐老师教的,好了,那么问题变成了:访问为什么会出现 something went wrong 这种错误呢?
    10 条回复    2017-05-03 15:54:29 +08:00
    hisway
        1
    hisway  
       2017-05-03 14:22:04 +08:00
    www.qq.com 这个就叫二级域名吧。他的要求其实 http://{}/ ,在{}内的设置一样的就可以用
    alvy
        2
    alvy  
    OP
       2017-05-03 14:42:23 +08:00
    @hisway 但是文档里面说“但 http://pay.qq.comhttp://music.qq.comhttp://qq.com 无法进行 OAuth2.0 鉴权”啊
    manhere
        3
    manhere  
       2017-05-03 14:43:58 +08:00 via Android
    @alvy 语文课去网吧了😄
    hisway
        4
    hisway  
       2017-05-03 14:45:31 +08:00
    @alvy #2 微信后台设置了` www.qq.com`,那 `pay.qq.com`、`music.qq.com` 这些当然不能,只能 `www.qq.com` 下面的。
    kamal
        5
    kamal  
       2017-05-03 14:47:08 +08:00
    楼主自动把 www 过滤掉了,就像 ps 的灰白背景 2333
    xycool
        6
    xycool  
       2017-05-03 14:49:23 +08:00
    网页授权的域名为: http://a.qq.com,页面 http://a.qq.com/1.html,http://a.qq.com/2.html 可以,
    其他比如 b.qq.com/1.html,b.qq.com/2.html 就不行了。
    alvy
        7
    alvy  
    OP
       2017-05-03 14:51:21 +08:00
    @manhere 达叔,一语惊醒梦中人
    alvy
        8
    alvy  
    OP
       2017-05-03 14:53:00 +08:00
    那么为什么会出现访问错误呢?
    alvy
        9
    alvy  
    OP
       2017-05-03 14:53:36 +08:00
    楼上各位,我错了,面壁去。那么问题变成了:我都配置好了,怎么会出现访问错误呢
    manhere
        10
    manhere  
       2017-05-03 15:54:29 +08:00 via Android
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5678 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:25 · PVG 10:25 · LAX 19:25 · JFK 22:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.