Code Monkey home page Code Monkey logo

oauth's Introduction

微信多个域名网页授权

由于微信只能设置3个网页授权的地址,而实际使用中可能需要多个域名来部署多个项目

授权页面跳转网址:http://oauth.domain/index.php?target=http://user.domain&scope=snsapi_userinfo

  • oauth.domain: 本系统的网址;
  • user.domain: 需要网页授权的网址;
  • scope: 默认snsapi_base,可选两个值snsapi_base,snsapi_userinfo
  • 授权后会跳转到:http://user.domain?openid=xxx,其中openid即是用户的openid

使用方法

  1. 将你的appid和secret设置到index.php中相应的位置
  2. 将域名解析到如oauth.xxx.com
  3. 将微信公众平台的网页授权地址添加一项 oauth.xxx.com(上一步设置的域名
  4. 将那个验证文件上传到oauth.xxx.com的根目录,验证
  5. 再次解析一个域名shop.xxx.com
  6. shop.xxx.com域名创建index.html,并设置a标签授权
  7. 用微信开发者工具访问http://shop.xxx.com,并点击授权,查看浏览器地址返回http://shop.xxx.com?openid=xxx

oauth's People

Contributors

gaolegaole avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

oauth's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.