// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/security/authentication/WeChatMpOAuth2AccessTokenAuthentication.java
// public class WeChatMpOAuth2AccessTokenAuthentication implements Authentication {
// 
//     private final WxMpOAuth2AccessToken accessToken;
// 
//     public WeChatMpOAuth2AccessTokenAuthentication(WxMpOAuth2AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     @Override
//     public Collection<? extends GrantedAuthority> getAuthorities() {
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public Object getCredentials() {
//         return null;
//     }
// 
//     @Override
//     public Object getDetails() {
//         return getOpenId();
//     }
// 
//     @Override
//     public Object getPrincipal() {
//         return getOpenId();
//     }
// 
//     @Override
//     public boolean isAuthenticated() {
//         return true;
//     }
// 
//     @Override
//     public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
// 
//     }
// 
//     @Override
//     public String getName() {
//         return accessToken.getOpenId();
//     }
// 
//     public OpenId getOpenId() {
//         return OpenId.valueOf(accessToken.getOpenId());
//     }
// }


import com.github.hippoom.wechat.mp.security.authentication.WeChatMpOAuth2AccessTokenAuthentication;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.Setter;
import lombok.SneakyThrows;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.security.web.util.matcher.RequestMatcher;
package com.github.hippoom.wechat.mp.security.web.authentication;


public class WeChatMpOAuth2AuthenticationProcessingFilter
    extends AbstractAuthenticationProcessingFilter {

    @Setter
    private WxMpService wxMpService;

// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/security/authentication/WeChatMpOAuth2AccessTokenAuthentication.java
// public class WeChatMpOAuth2AccessTokenAuthentication implements Authentication {
// 
//     private final WxMpOAuth2AccessToken accessToken;
// 
//     public WeChatMpOAuth2AccessTokenAuthentication(WxMpOAuth2AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     @Override
//     public Collection<? extends GrantedAuthority> getAuthorities() {
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public Object getCredentials() {
//         return null;
//     }
// 
//     @Override
//     public Object getDetails() {
//         return getOpenId();
//     }
// 
//     @Override
//     public Object getPrincipal() {
//         return getOpenId();
//     }
// 
//     @Override
//     public boolean isAuthenticated() {
//         return true;
//     }
// 
//     @Override
//     public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
// 
//     }
// 
//     @Override
//     public String getName() {
//         return accessToken.getOpenId();
//     }
// 
//     public OpenId getOpenId() {
//         return OpenId.valueOf(accessToken.getOpenId());
//     }
// }


// Path: wechat-mp-autoconfigure/src/main/java/com/github/hippoom/wechat/mp/security/web/authentication/WeChatMpOAuth2AuthenticationProcessingFilter.java
import com.github.hippoom.wechat.mp.security.authentication.WeChatMpOAuth2AccessTokenAuthentication;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.Setter;
import lombok.SneakyThrows;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
import org.springframework.security.web.util.matcher.RequestMatcher;

package com.github.hippoom.wechat.mp.security.web.authentication;


public class WeChatMpOAuth2AuthenticationProcessingFilter
    extends AbstractAuthenticationProcessingFilter {

    @Setter
    private WxMpService wxMpService;

    public WeChatMpOAuth2AuthenticationProcessingFilter(String defaultFilterProcessesUrl) {