一、资料
- 钉钉免登录方案:https://open.dingtalk.com/document/orgapp-server/sso-overview
二、实现
2.1 钉钉实现免登录第三方网站
- 实现后的效果:生成一个链接,点击后确认授权。如下:
https://login.dingtalk.com/oauth2/auth?redirect_uri=http%3A%2F%2F5htss3.natappfree.cc%2Fweb%2Fmanage%2FgetUserInfo&response_type=code&client_id=dinglftd50hbjdj2yfzz&scope=openid&state=dddd&prompt=consent
- 参考文档:
-
- https://open.dingtalk.com/document/orgapp-server/logon-free-third-party-websites
-
- https://open.dingtalk.com/document/orgapp-server/tutorial-obtaining-user-personal-information
2.2 钉钉实现企业内部应用免登录
实现步骤:
a. 前端获取免登录授权码
b. 服务端获取access_token
c. 服务端根据access_token,免登录授权码获取user_id
d. 服务端根据user_id获取用户信息
2.3 企业微信实现网页授权登录
- 实现逻辑和2.1钉钉一致。
- 参考文档:https://developer.work.weixin.qq.com/document/path/91335
- 流程:
2.4 消息发送
- 企微:https://developer.work.weixin.qq.com/document/path/90236#markdown%E6%B6%88%E6%81%AF