public class ComponentProxy extends MPlatformProxy
Description:
tokenManagerweixinRequestClient| 构造器和说明 |
|---|
ComponentProxy(TicketManager ticketManager) |
ComponentProxy(TicketManager ticketManager,
String componentOauthRedirectUrl) |
| 限定符和类型 | 方法和说明 |
|---|---|
ComponentAuthorizerToken |
exchangeAuthorizerToken(String authCode)
使用授权码换取公众号的接口调用凭据和授权信息:用于使用授权码换取授权公众号的授权信息,
并换取authorizer_access_token和authorizer_refresh_token。
|
OauthToken |
getAuthorizationToken(String authAppId,
String code)
第三方组件代替授权公众号发起网页授权:换取token
|
ComponentAuthorizer |
getAuthorizerInfo(String authAppId)
获取授权方的公众号帐号基本信息:获取授权方的公众号基本信息,包括头像、昵称、帐号类型、认证类型、微信号、原始ID和二维码图片URL。
|
ComponentAuthorizerOption |
getAuthorizerOption(String authAppId,
ComponentAuthorizerOption.AuthorizerOptionName optionName)
获取授权方的公众号的选项设置信息,如:地理位置上报,语音识别开关,多客服开关。
|
TokenManager |
getPreCodeManager()
应用组件预授权码
|
TicketPermanentManager |
getRefreshTokenManager(String authAppId)
应用套组件永久刷新令牌:刷新令牌主要用于公众号第三方平台获取和刷新已授权用户的access_token,只会在授权时刻提供,请妥善保存。
|
TicketManager |
getTicketManager()
应用组件ticket
|
String |
getUserAuthorizationURL(String authAppId)
第三方组件代替授权公众号发起网页授权:获取code
redirectUri默认填写weixin4j.properties#component.user.oauth.redirect.uri
scope默认填写snsapi_base
state默认填写state
|
String |
getUserAuthorizationURL(String authAppId,
String redirectUri,
String scope,
String state)
第三方组件代替授权公众号发起网页授权:获取code
|
OauthToken |
refreshAuthorizationToken(String authAppId,
String refreshToken)
第三方组件代替授权公众号发起网页授权:刷新token
|
ApiResult |
setAuthorizerOption(String authAppId,
ComponentAuthorizerOption option)
设置授权方的公众号的选项信息,如:地理位置上报,语音识别开关,多客服开关。
|
getTokenManagerpublic ComponentProxy(TicketManager ticketManager)
public ComponentProxy(TicketManager ticketManager, String componentOauthRedirectUrl)
public TicketManager getTicketManager()
public TokenManager getPreCodeManager()
public TicketPermanentManager getRefreshTokenManager(String authAppId)
authAppId - 授权方appidpublic String getUserAuthorizationURL(String authAppId)
authAppId - 公众号的appidgetUserAuthorizationURL(String),
第三方组件代替授权公众号发起网页授权public String getUserAuthorizationURL(String authAppId, String redirectUri, String scope, String state)
authAppId - 公众号的appidredirectUri - 重定向地址,这里填写的应是服务开发方的回调地址scope - 应用授权作用域,snsapi_base/snsapi_userinfostate - 重定向后会带上state参数,开发者可以填写任意参数值,最多128字节public OauthToken getAuthorizationToken(String authAppId, String code) throws WeixinException
authAppId - 公众号的appidcode - 用户同意授权获取的codeWeixinExceptiongetUserAuthorizationURL(String, String, String, String),
OauthTokenpublic OauthToken refreshAuthorizationToken(String authAppId, String refreshToken) throws WeixinException
authAppId - 公众号的appidrefreshToken - 填写通过access_token获取到的refresh_token参数WeixinExceptiongetAuthorizationToken(String, String),
OauthProxy.getAuthorizationUser(OauthToken),
OauthTokenpublic ComponentAuthorizerToken exchangeAuthorizerToken(String authCode) throws WeixinException
authCode - 授权codeWeixinExceptionComponentAuthorizerTokenpublic ComponentAuthorizer getAuthorizerInfo(String authAppId) throws WeixinException
authAppId - 授权方appidWeixinExceptionComponentAuthorizerpublic ComponentAuthorizerOption getAuthorizerOption(String authAppId, ComponentAuthorizerOption.AuthorizerOptionName optionName) throws WeixinException
authAppId - 授权方appidoptionName - 选项名称WeixinExceptionComponentAuthorizerOptionpublic ApiResult setAuthorizerOption(String authAppId, ComponentAuthorizerOption option) throws WeixinException
option - 选项信息WeixinExceptionComponentAuthorizerOptionCopyright © 2020. All rights reserved.