public class WechatOauth2Template
extends org.springframework.social.oauth2.OAuth2Template
Constructor and Description |
---|
WechatOauth2Template(String clientId,
String clientSecret,
String authorizeUrl,
String accessTokenUrl) |
Modifier and Type | Method and Description |
---|---|
String |
buildAuthenticateUrl(org.springframework.social.oauth2.OAuth2Parameters parameters)
构建获取授权码的请求。也就是引导用户跳转到微信的地址。
|
String |
buildAuthorizeUrl(org.springframework.social.oauth2.OAuth2Parameters parameters) |
protected org.springframework.web.client.RestTemplate |
createRestTemplate()
微信返回的contentType是html/text,添加相应的HttpMessageConverter来处理。
|
org.springframework.social.oauth2.AccessGrant |
exchangeForAccess(String authorizationCode,
String redirectUri,
org.springframework.util.MultiValueMap<String,String> parameters) |
org.springframework.social.oauth2.AccessGrant |
refreshAccess(String refreshToken,
org.springframework.util.MultiValueMap<String,String> additionalParameters) |
authenticateClient, authenticateClient, buildAuthenticateUrl, buildAuthorizeUrl, createAccessGrant, exchangeCredentialsForAccess, getRestTemplate, postForAccessGrant, refreshAccess, setRequestFactory, setUseParametersForClientAuthentication
public org.springframework.social.oauth2.AccessGrant exchangeForAccess(String authorizationCode, String redirectUri, org.springframework.util.MultiValueMap<String,String> parameters)
exchangeForAccess
in interface org.springframework.social.oauth2.OAuth2Operations
exchangeForAccess
in class org.springframework.social.oauth2.OAuth2Template
public org.springframework.social.oauth2.AccessGrant refreshAccess(String refreshToken, org.springframework.util.MultiValueMap<String,String> additionalParameters)
refreshAccess
in interface org.springframework.social.oauth2.OAuth2Operations
refreshAccess
in class org.springframework.social.oauth2.OAuth2Template
public String buildAuthenticateUrl(org.springframework.social.oauth2.OAuth2Parameters parameters)
buildAuthenticateUrl
in interface org.springframework.social.oauth2.OAuth2Operations
buildAuthenticateUrl
in class org.springframework.social.oauth2.OAuth2Template
public String buildAuthorizeUrl(org.springframework.social.oauth2.OAuth2Parameters parameters)
buildAuthorizeUrl
in interface org.springframework.social.oauth2.OAuth2Operations
buildAuthorizeUrl
in class org.springframework.social.oauth2.OAuth2Template
protected org.springframework.web.client.RestTemplate createRestTemplate()
createRestTemplate
in class org.springframework.social.oauth2.OAuth2Template
Copyright © 2021. All rights reserved.