All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.dcenter.ums.security.social.provider.weixin.connect.WeixinAccessGrant Maven / Gradle / Ivy

Go to download

ums-social feature: OAuth2(qq,weixin,weibo,gitee), binding and unbinding, routing function of multiple callback addresses through a unified callback address entry.

The newest version!
/**
 * 
 */
package top.dcenter.ums.security.social.provider.weixin.connect;

import lombok.Getter;
import org.springframework.social.oauth2.AccessGrant;

/**
 * 微信的access_token信息。与标准OAuth2协议不同,微信在获取access_token时会同时返回openId,并没有单独的通过accessToke换取openId的服务
 * 
 * 所以在这里继承了标准AccessGrant,添加了openId字段,作为对微信access_token信息的封装。
 * 
 * @author zhailiang
 *
 */
public class WeixinAccessGrant extends AccessGrant {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7243374526633186782L;
	
	private String openId;
	@Getter
	private Long expiresIn;

	public WeixinAccessGrant() {
		super("");
	}

	public WeixinAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn) {
		super(accessToken, scope, refreshToken, expiresIn);
		this.expiresIn = expiresIn * 1000L;
	}

	/**
	 * @return the openId
	 */
	public String getOpenId() {
		return openId;
	}

	/**
	 * @param openId the openId to set
	 */
	public void setOpenId(String openId) {
		this.openId = openId;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy