开发者教程

本页提供:系统简介、业务站接入步骤、OAuth2/Token、WeCom 登录、常见错误排查。

一、系统简介
二、业务站接入(最小步骤)
  1. 在“应用管理”创建应用,记下 client_id/client_secret,填写“主回调”和“允许回调”。
  2. 业务站发起:
    GET /oauth/authorize?client_id=APP_xxx&redirect_uri={urlencode(回调)}&response_type=code&scope=basic&state=随机
    Host: SSO
  3. 回调后,用授权码换令牌:
    POST /oauth/token
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code&code=xxx&redirect_uri=原回调&client_id=APP_xxx&client_secret=***
  4. 验证 JWT(HS256,密钥=应用的 client_secret),再以 Authorization: Bearer {access_token}/userinfo
三、企业微信
四、错误排查

更多细节可查看 /debug 自检页。