Java Code Examples for org.springframework.social.oauth2.TokenStrategy#ACCESS_TOKEN_PARAMETER

The following examples show how to use org.springframework.social.oauth2.TokenStrategy#ACCESS_TOKEN_PARAMETER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QQImpl.java    From cola with MIT License 5 votes vote down vote up
/**
 * 构造方法获取openId
 */
public QQImpl(String accessToken, String appId) {
	//access_token作为查询参数来携带。
	super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);

	this.appId = appId;

	String url = String.format(QQ_URL_GET_OPENID, accessToken);
	String result = getRestTemplate().getForObject(url, String.class);

	log.info("【QQImpl】 QQ_URL_GET_OPENID={} result={}", url, result);

	this.openId = StringUtils.substringBetween(result, "\"openid\":\"", "\"}");
}
 
Example 2
Source File: QQImpl.java    From pre with GNU General Public License v3.0 5 votes vote down vote up
public QQImpl(String accessToken, String appid) {
    //将token作为查询参数
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
    this.appid = appid;

    //拼接成最终的openid的请求地址
    String url = String.format(URL_GET_OPENID, accessToken);
    String result = getRestTemplate().getForObject(url, String.class);
    this.openid = StringUtils.substringBetween(result, "\"openid\":\"", "\"}");
}
 
Example 3
Source File: QQImpl.java    From FEBS-Security with Apache License 2.0 5 votes vote down vote up
public QQImpl(String accessToken, String appId) {
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
    this.appId = appId;
    String url = String.format(FebsConstant.GET_QQ_OPEN_ID_URL, accessToken);
    String result = this.getRestTemplate().getForObject(url, String.class);

    log.info(result);
    this.openId = StringUtils.substringBetween(result, "\"openid\":\"", "\"}");
}
 
Example 4
Source File: WechatImpl.java    From cola with MIT License 4 votes vote down vote up
public WechatImpl(String accessToken) {
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
}
 
Example 5
Source File: WechatMpImpl.java    From cola with MIT License 4 votes vote down vote up
public WechatMpImpl(String accessToken) {
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
}
 
Example 6
Source File: WeiXinImpl.java    From pre with GNU General Public License v3.0 4 votes vote down vote up
public WeiXinImpl(String accessToken) {
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
}
 
Example 7
Source File: WechatImpl.java    From spring-social-wechat with Apache License 2.0 4 votes vote down vote up
public WechatImpl(String accessToken) {
	super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
	userOperations = new UserTemplate(restOperations(), accessToken);
}
 
Example 8
Source File: WeiXinImpl.java    From FEBS-Security with Apache License 2.0 4 votes vote down vote up
public WeiXinImpl(String accessToken) {
    super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
}
 
Example 9
Source File: QQImpl.java    From paascloud-master with Apache License 2.0 3 votes vote down vote up
/**
 * Instantiates a new Qq.
 *
 * @param accessToken the access token
 * @param appId       the app id
 */
public QQImpl(String accessToken, String appId) {
	super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);

	this.appId = appId;

	String url = String.format(URL_GET_OPENID, accessToken);
	String result = getRestTemplate().getForObject(url, String.class);

	log.info("result={}", result);

	this.openId = StringUtils.substringBetween(result, "\"openid\":\"", "\"}");
}
 
Example 10
Source File: WeixinImpl.java    From paascloud-master with Apache License 2.0 2 votes vote down vote up
/**
 * Instantiates a new Weixin.
 *
 * @param accessToken the access token
 */
public WeixinImpl(String accessToken) {
	super(accessToken, TokenStrategy.ACCESS_TOKEN_PARAMETER);
}