parent
090e0cd867
commit
24ac928fb9
@ -0,0 +1,21 @@
|
|||||||
|
package com.yami.shop.admin.security;
|
||||||
|
|
||||||
|
import com.yami.shop.common.util.Json;
|
||||||
|
import com.yami.shop.security.provider.AuthenticationTokenParser;
|
||||||
|
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdminAuthenticationTokenParser
|
||||||
|
*
|
||||||
|
* @author hanfeng
|
||||||
|
* @date 2019-08-21
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class AdminAuthenticationTokenParser implements AuthenticationTokenParser {
|
||||||
|
@Override
|
||||||
|
public AbstractAuthenticationToken parse(String authenticationTokenStr) {
|
||||||
|
AdminAuthenticationToken authRequest = Json.parseObject(authenticationTokenStr, AdminAuthenticationToken.class);
|
||||||
|
return authRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.yami.shop.api.security;
|
||||||
|
|
||||||
|
import com.yami.shop.common.util.Json;
|
||||||
|
import com.yami.shop.security.provider.AuthenticationTokenParser;
|
||||||
|
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MiniAppAuthenticationTokenParser
|
||||||
|
*
|
||||||
|
* @author hanfeng
|
||||||
|
* @date 2019-08-21
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MiniAppAuthenticationTokenParser implements AuthenticationTokenParser {
|
||||||
|
@Override
|
||||||
|
public AbstractAuthenticationToken parse(String authenticationTokenStr) {
|
||||||
|
MiniAppAuthenticationToken authRequest = Json.parseObject(authenticationTokenStr, MiniAppAuthenticationToken.class);
|
||||||
|
return authRequest;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.yami.shop.security.provider;
|
||||||
|
|
||||||
|
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AuthenticationTokenParser
|
||||||
|
*
|
||||||
|
* @author hanfeng
|
||||||
|
* @date 2019-08-21
|
||||||
|
*/
|
||||||
|
public interface AuthenticationTokenParser {
|
||||||
|
AbstractAuthenticationToken parse(String authenticationTokenStr);
|
||||||
|
}
|
||||||
Loading…
Reference in new issue