mirror of
https://gitee.com/fujieid/jap.git
synced 2024-11-30 02:27:34 +08:00
🚑 Supports custom caching
This commit is contained in:
parent
159ee2d45a
commit
bb3779c246
@ -16,7 +16,7 @@
|
||||
/**
|
||||
* To provide processing methods for business in OAuth authorization process, the usage is as follows:
|
||||
* <p>
|
||||
* {@link com.fujieid.jap.oauth2.helper.AccessTokenHelper#getToken(HttpServletRequest, OAuthConfig)}
|
||||
* {@link com.fujieid.jap.oauth2.token.AccessTokenHelper#getToken(HttpServletRequest, OAuthConfig)}
|
||||
* According to the parameters in {@link com.fujieid.jap.oauth2.OAuthConfig}, determine which authorization mode token data to obtain
|
||||
* <p>
|
||||
* For OAuth's grant type, the following private methods are provided:
|
||||
@ -34,7 +34,7 @@
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7636#section-6.1" target="_blank">6.1. OAuth Parameters Registry</a>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package com.fujieid.jap.oauth2.helper;
|
||||
package com.fujieid.jap.oauth2.token;
|
||||
|
||||
import com.fujieid.jap.oauth2.OAuthConfig;
|
||||
|
@ -20,8 +20,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.fujieid.jap.core.AuthenticateConfig;
|
||||
import com.fujieid.jap.core.JapConfig;
|
||||
import com.fujieid.jap.core.JapUserService;
|
||||
import com.fujieid.jap.core.cache.JapCache;
|
||||
import com.fujieid.jap.core.exception.JapOauth2Exception;
|
||||
import com.fujieid.jap.core.store.JapUserStore;
|
||||
import com.fujieid.jap.oauth2.OAuthConfig;
|
||||
import com.fujieid.jap.oauth2.Oauth2Strategy;
|
||||
|
||||
@ -54,11 +54,11 @@ public class OidcStrategy extends Oauth2Strategy {
|
||||
* `Strategy` constructor.
|
||||
*
|
||||
* @param japUserService japUserService
|
||||
* @param japUserStore japUserStore
|
||||
* @param japConfig japConfig
|
||||
* @param japCache japCache
|
||||
*/
|
||||
public OidcStrategy(JapUserService japUserService, JapUserStore japUserStore, JapConfig japConfig) {
|
||||
super(japUserService, japUserStore, japConfig);
|
||||
public OidcStrategy(JapUserService japUserService, JapConfig japConfig, JapCache japCache) {
|
||||
super(japUserService, japConfig, japCache);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,8 +22,8 @@ import com.fujieid.jap.core.AuthenticateConfig;
|
||||
import com.fujieid.jap.core.JapConfig;
|
||||
import com.fujieid.jap.core.JapUser;
|
||||
import com.fujieid.jap.core.JapUserService;
|
||||
import com.fujieid.jap.core.cache.JapCache;
|
||||
import com.fujieid.jap.core.exception.JapUserException;
|
||||
import com.fujieid.jap.core.store.JapUserStore;
|
||||
import com.fujieid.jap.core.strategy.AbstractJapStrategy;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
@ -54,11 +54,11 @@ public class SimpleStrategy extends AbstractJapStrategy {
|
||||
* `Strategy` constructor.
|
||||
*
|
||||
* @param japUserService japUserService
|
||||
* @param japUserStore japUserStore
|
||||
* @param japConfig japConfig
|
||||
* @param japCache japCache
|
||||
*/
|
||||
public SimpleStrategy(JapUserService japUserService, JapUserStore japUserStore, JapConfig japConfig) {
|
||||
super(japUserService, japUserStore, japConfig);
|
||||
public SimpleStrategy(JapUserService japUserService, JapConfig japConfig, JapCache japCache) {
|
||||
super(japUserService, japConfig, japCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fujieid.jap.core.*;
|
||||
import com.fujieid.jap.core.cache.JapCache;
|
||||
import com.fujieid.jap.core.exception.JapSocialException;
|
||||
import com.fujieid.jap.core.exception.JapUserException;
|
||||
import com.fujieid.jap.core.store.JapUserStore;
|
||||
@ -67,11 +68,11 @@ public class SocialStrategy extends AbstractJapStrategy {
|
||||
* `Strategy` constructor.
|
||||
*
|
||||
* @param japUserService japUserService
|
||||
* @param japUserStore japUserStore
|
||||
* @param japConfig japConfig
|
||||
* @param japCache japCache
|
||||
*/
|
||||
public SocialStrategy(JapUserService japUserService, JapUserStore japUserStore, JapConfig japConfig) {
|
||||
super(japUserService, japUserStore, japConfig);
|
||||
public SocialStrategy(JapUserService japUserService, JapConfig japConfig, JapCache japCache) {
|
||||
super(japUserService, japConfig, japCache);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,12 +81,11 @@ public class SocialStrategy extends AbstractJapStrategy {
|
||||
* please refer to: https://justauth.wiki/features/customize-the-state-cache.html
|
||||
*
|
||||
* @param japUserService Required, implement user operations
|
||||
* @param japUserStore Required
|
||||
* @param japConfig Required, jap config
|
||||
* @param authStateCache Optional, custom cache implementation class
|
||||
*/
|
||||
public SocialStrategy(JapUserService japUserService, JapUserStore japUserStore, JapConfig japConfig, AuthStateCache authStateCache) {
|
||||
this(japUserService, japUserStore, japConfig);
|
||||
public SocialStrategy(JapUserService japUserService, JapConfig japConfig, AuthStateCache authStateCache) {
|
||||
this(japUserService, japConfig);
|
||||
this.authStateCache = authStateCache;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user