05 oauth2

2020-09-28  本文已影响0人  格林哈

0 基础

1 授权类型

1.1 授权码模式

{
  "access_token": "37_iSnKFdlhiPaUUS8fcttaUc4arw1x__YxgPlflHUstbkIeiDFU6sO8MrJQ0Rhj1TCOV_jk68gKPLoOvKZeEHpLRt-x5smDrjYEYMBrZhb0",
  "expires_in": 7200,
  "refresh_token": "37_na1tDQsOrphZX3ybr6OyBX5hv7s1m1bW6oc0ry2GsYIjlH0mZs9ZjYQC_1q-ZHkCL4tXbl3gS4DDPy2EKgX72aLrTJujN_KfGIeVVilwc",
  "openid": "oPG8J1m5cGDcpP1yE1I9v2mNGM",
  "scope": "snsapi_login",
  "unionid": "oBEh1523T_L6H_WBsV4pg-o8bmM"
}

1.2 简化模式

1.3 密码模式

header 中
Authorization: Basic c2hhcmUtY2xpZW50LXVzYzpzaGNsaWVudFNlY3JldA==
http://dev.weepal.info/share-gateway/usc/auth/form?grant_type=password&username=13&password=13&imageCode=8259

1.4 客户端模式

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyIqIl0sImV4cCI6MTU1OTAxOTAxNywianRpIjoiZGMzZGZiYTEtMGVmNy00ZTg1LWI1OTgtZmRiZjYwNzJiMmVhIiwiY2xpZW50X2lkIjoic2hhcmUtY2xpZW50LXVzYyIsInRpbWVzdGFtcCI6MTU1OTAxMTgxNzc1NX0.FN_y50MD0XuO2O5ooOS24_-1_t9XXXrhxi1eR47xajE",
"token_type": "bearer",
"expires_in": 7199,
"scope": "*",
"timestamp": "1559011817755",
"jti": "dc3dfba1-0ef7-4e85-b598-fdbf6072b2ea"
}

2 授权过程

2.2 微信三方登录授权过程 (授权码模式)

https://open.weixin.qq.com/connect/qrconnect?client_id=wxde780db2538135&response_type=code&redirect_uri=http%3A%2F%2Fdev.weepal.info%2Fshare%2Flogin&state=72fc22bd-a5-4166-b87d-0f04d2329b40&appid=wxde7db253813d05&scope=snsapi_login
http://dev.weepal.info/share-gateway/usc/shareSocial/auth/weixin?code=061O9S000uq3nK1qcA3007k0C62O9S0w&state=72fc22bd-18a5-4166-b87d-0f04d2329b40

上一篇下一篇

猜你喜欢

热点阅读