com.healthy.common.security.social.qq.connet.QQOAuth2ServiceProvider Maven / Gradle / Ivy
package com.healthy.common.security.social.qq.connet;
import com.healthy.common.security.social.qq.api.QQ;
import com.healthy.common.security.social.qq.api.impl.QQImpl;
import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
public class QQOAuth2ServiceProvider extends AbstractOAuth2ServiceProvider {
private static final String URL_AUTHORIZE = "https://graph.qq.com/oauth2.0/authorize";
private static final String URL_ACCESS_TOKEN = "https://graph.qq.com/oauth2.0/token";
private final String appId;
public QQOAuth2ServiceProvider(String appId, String appSecret) {
super(new QQOAuth2Template(appId, appSecret, URL_AUTHORIZE, URL_ACCESS_TOKEN));
this.appId = appId;
}
@Override
public QQ getApi(String accessToken) {
return new QQImpl(accessToken, appId);
}
}