public interface AuthApi
Modifier and Type | Method and Description |
---|---|
WeComResponse |
authsucc(String userid)
此接口可以满足安全性要求高的企业进行成员验证。
开启二次验证后,当且仅当成员登录时,需跳转至企业自定义的页面进行验证。验证频率可在设置页面选择。
|
WeComResponse |
authsucc(TfaUser tfaUser)
使用二次验证
|
TfaInfoResponse |
getTfaInfo(Code code)
获取用户二次验证信息
|
UserSensitiveInfoResponse |
getUserDetail(UserTicket userTicket)
获取访问用户敏感信息,需要授权scope包含
snsapi_privateinfo |
UserDetailResponse |
getUserInfo(String code)
获取访问用户身份
|
@GET(value="auth/getuserinfo") UserDetailResponse getUserInfo(@Query(value="code") String code) throws WeComException
该接口用于根据code获取成员信息,适用于自建应用与代开发应用
code
- 通过成员授权获取到的codeWeComException
- the weComException@POST(value="auth/getuserdetail") UserSensitiveInfoResponse getUserDetail(@Body UserTicket userTicket) throws WeComException
snsapi_privateinfo
自建应用与代开发应用可通过该接口获取成员授权的敏感字段
userTicket
- 成员票据WeComException
- the weComException@POST(value="auth/get_tfa_info") TfaInfoResponse getTfaInfo(@Body Code code) throws WeComException
仅『通讯录同步』或者自建应用可调用,如用自建应用调用,用户需要在二次验证范围和应用可见范围内
code
- the codeWeComException
- the weComException@GET(value="user/tfa_succ") WeComResponse authsucc(@Query(value="userid") String userid) throws WeComException
企业在开启二次验证时,必须在管理端填写企业二次验证页面的url。 当成员登录企业微信或关注微信插件(原企业号)进入企业时,会自动跳转到企业的验证页面。 在跳转到企业的验证页面时,会带上如下参数:code=CODE。 企业收到code后,使用“通讯录同步助手”调用接口"根据code获取成员信息"获取成员的userid。 如果成员是首次加入企业,企业获取到userid,并验证了成员信息后,调用如下接口即可让成员成功加入企业。
userid
- the useridWeComException
- the weComException@POST(value="user/tfa_succ") WeComResponse authsucc(@Body TfaUser tfaUser) throws WeComException
仅『通讯录同步』或者自建应用可调用,如用自建应用调用,用户需要在二次验证范围和应用可见范围内。
tfaUser
- the tfa userWeComException
- the weComExceptionCopyright © 2025. All rights reserved.