mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-14 04:22:08 +08:00
代码优化
This commit is contained in:
@@ -107,26 +107,26 @@ public class OAuth2Constants {
|
||||
|
||||
public static class ENDPOINT{
|
||||
|
||||
public final static String ENDPOINT_BASE = "/authz/oauth/v20";
|
||||
public static final String ENDPOINT_BASE = "/authz/oauth/v20";
|
||||
|
||||
public final static String ENDPOINT_AUTHORIZE = ENDPOINT_BASE + "/authorize";
|
||||
public static final String ENDPOINT_AUTHORIZE = ENDPOINT_BASE + "/authorize";
|
||||
|
||||
public final static String ENDPOINT_TOKEN = ENDPOINT_BASE + "/token";
|
||||
public static final String ENDPOINT_TOKEN = ENDPOINT_BASE + "/token";
|
||||
|
||||
public final static String ENDPOINT_CHECK_TOKEN = ENDPOINT_BASE + "/check_token";
|
||||
public static final String ENDPOINT_CHECK_TOKEN = ENDPOINT_BASE + "/check_token";
|
||||
|
||||
public final static String ENDPOINT_TOKEN_KEY = ENDPOINT_BASE + "/token_key";
|
||||
public static final String ENDPOINT_TOKEN_KEY = ENDPOINT_BASE + "/token_key";
|
||||
|
||||
public final static String ENDPOINT_APPROVAL_CONFIRM = ENDPOINT_BASE + "/approval_confirm";
|
||||
public static final String ENDPOINT_APPROVAL_CONFIRM = ENDPOINT_BASE + "/approval_confirm";
|
||||
|
||||
public final static String ENDPOINT_ERROR = ENDPOINT_BASE + "/error";
|
||||
public static final String ENDPOINT_ERROR = ENDPOINT_BASE + "/error";
|
||||
|
||||
public final static String ENDPOINT_USERINFO = "/api/oauth/v20/me";
|
||||
public static final String ENDPOINT_USERINFO = "/api/oauth/v20/me";
|
||||
|
||||
public final static String ENDPOINT_OPENID_CONNECT_USERINFO = "/api/connect/v10/userinfo";
|
||||
public static final String ENDPOINT_OPENID_CONNECT_USERINFO = "/api/connect/v10/userinfo";
|
||||
|
||||
public final static String ENDPOINT_TENCENT_IOA_AUTHORIZE = "/oauth2/authorize";
|
||||
public final static String ENDPOINT_TENCENT_IOA_TOKEN = "/oauth2/token";
|
||||
public static final String ENDPOINT_TENCENT_IOA_AUTHORIZE = "/oauth2/authorize";
|
||||
public static final String ENDPOINT_TENCENT_IOA_TOKEN = "/oauth2/token";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,17 +26,17 @@ package org.dromara.maxkey.authz.oauth2.jwt.codec;
|
||||
final class Base64Codec {
|
||||
|
||||
/** No options specified. Value is zero. */
|
||||
public final static int NO_OPTIONS = 0;
|
||||
public static final int NO_OPTIONS = 0;
|
||||
|
||||
/** Specify encoding in first bit. Value is one. */
|
||||
public final static int ENCODE = 1;
|
||||
public static final int ENCODE = 1;
|
||||
|
||||
|
||||
/** Specify decoding in first bit. Value is zero. */
|
||||
public final static int DECODE = 0;
|
||||
public static final int DECODE = 0;
|
||||
|
||||
/** Do break lines when encoding. Value is 8. */
|
||||
public final static int DO_BREAK_LINES = 8;
|
||||
public static final int DO_BREAK_LINES = 8;
|
||||
|
||||
/**
|
||||
* Encode using Base64-like encoding that is URL- and Filename-safe as described
|
||||
@@ -46,36 +46,36 @@ final class Base64Codec {
|
||||
* or at the very least should not be called Base64 without also specifying that is
|
||||
* was encoded using the URL- and Filename-safe dialect.
|
||||
*/
|
||||
public final static int URL_SAFE = 16;
|
||||
public static final int URL_SAFE = 16;
|
||||
|
||||
|
||||
/**
|
||||
* Encode using the special "ordered" dialect of Base64 described here:
|
||||
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
|
||||
*/
|
||||
public final static int ORDERED = 32;
|
||||
public static final int ORDERED = 32;
|
||||
|
||||
|
||||
/** Maximum line length (76) of Base64 output. */
|
||||
private final static int MAX_LINE_LENGTH = 76;
|
||||
private static final int MAX_LINE_LENGTH = 76;
|
||||
|
||||
|
||||
/** The equals sign (=) as a byte. */
|
||||
private final static byte EQUALS_SIGN = (byte)'=';
|
||||
private static final byte EQUALS_SIGN = (byte)'=';
|
||||
|
||||
|
||||
/** The new line character (\n) as a byte. */
|
||||
private final static byte NEW_LINE = (byte)'\n';
|
||||
private static final byte NEW_LINE = (byte)'\n';
|
||||
|
||||
private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
||||
private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
||||
private static final byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
||||
private static final byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
||||
|
||||
|
||||
/* ******** S T A N D A R D B A S E 6 4 A L P H A B E T ******** */
|
||||
|
||||
/** The 64 valid Base64 values. */
|
||||
/* Host platform me be something funny like EBCDIC, so we hardcode these values. */
|
||||
private final static byte[] _STANDARD_ALPHABET = {
|
||||
private static final byte[] _STANDARD_ALPHABET = {
|
||||
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
|
||||
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
|
||||
(byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U',
|
||||
@@ -93,7 +93,7 @@ final class Base64Codec {
|
||||
* Translates a Base64 value to either its 6-bit reconstruction value
|
||||
* or a negative number indicating some other meaning.
|
||||
**/
|
||||
private final static byte[] _STANDARD_DECODABET = {
|
||||
private static final byte[] _STANDARD_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
@@ -135,7 +135,7 @@ final class Base64Codec {
|
||||
* <a href="http://www.faqs.org/rfcs/rfc3548.html">http://www.faqs.org/rfcs/rfc3548.html</a>.
|
||||
* Notice that the last two bytes become "hyphen" and "underscore" instead of "plus" and "slash."
|
||||
*/
|
||||
private final static byte[] _URL_SAFE_ALPHABET = {
|
||||
private static final byte[] _URL_SAFE_ALPHABET = {
|
||||
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
|
||||
(byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
|
||||
(byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U',
|
||||
@@ -151,7 +151,7 @@ final class Base64Codec {
|
||||
/**
|
||||
* Used in decoding URL- and Filename-safe dialects of Base64.
|
||||
*/
|
||||
private final static byte[] _URL_SAFE_DECODABET = {
|
||||
private static final byte[] _URL_SAFE_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
@@ -198,7 +198,7 @@ final class Base64Codec {
|
||||
* and it is described here:
|
||||
* <a href="http://www.faqs.org/qa/rfcc-1940.html">http://www.faqs.org/qa/rfcc-1940.html</a>.
|
||||
*/
|
||||
private final static byte[] _ORDERED_ALPHABET = {
|
||||
private static final byte[] _ORDERED_ALPHABET = {
|
||||
(byte)'-',
|
||||
(byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4',
|
||||
(byte)'5', (byte)'6', (byte)'7', (byte)'8', (byte)'9',
|
||||
@@ -216,7 +216,7 @@ final class Base64Codec {
|
||||
/**
|
||||
* Used in decoding the "ordered" dialect of Base64.
|
||||
*/
|
||||
private final static byte[] _ORDERED_DECODABET = {
|
||||
private static final byte[] _ORDERED_DECODABET = {
|
||||
-9,-9,-9,-9,-9,-9,-9,-9,-9, // Decimal 0 - 8
|
||||
-5,-5, // Whitespace: Tab and Linefeed
|
||||
-9,-9, // Decimal 11 - 12
|
||||
|
||||
@@ -37,17 +37,15 @@ import org.dromara.maxkey.entity.apps.oauth2.provider.ClientDetails;
|
||||
import org.dromara.maxkey.entity.idm.UserInfo;
|
||||
import org.dromara.maxkey.persistence.cache.MomentaryService;
|
||||
import org.dromara.maxkey.persistence.service.AppsService;
|
||||
import org.dromara.maxkey.util.StrUtils;
|
||||
import org.dromara.maxkey.web.WebContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
@@ -103,7 +101,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
model.put("auth_request", clientAuth);
|
||||
model.put("client", client);
|
||||
model.put("oauth_version", "oauth 2.0");
|
||||
Map<String, String> scopes = new LinkedHashMap<String, String>();
|
||||
Map<String, String> scopes = new LinkedHashMap<>();
|
||||
for (String scope : clientAuth.getScope()) {
|
||||
scopes.put(OAuth2Constants.PARAMETER.SCOPE_PREFIX + scope, "false");
|
||||
}
|
||||
@@ -127,7 +125,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
ModelAndView modelAndView = new ModelAndView("authorize/oauth_access_confirmation");
|
||||
_logger.trace("Confirmation details ");
|
||||
for (Object key : model.keySet()) {
|
||||
_logger.trace("key " + key +"=" + model.get(key));
|
||||
_logger.trace("key {} = {}" , key, model.get(key));
|
||||
}
|
||||
|
||||
model.put("authorizeApproveUri", applicationConfig.getFrontendUri()+"/#/authz/oauth2approve");
|
||||
@@ -137,11 +135,12 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
}
|
||||
|
||||
@RequestMapping(OAuth2Constants.ENDPOINT.ENDPOINT_APPROVAL_CONFIRM+"/get/{oauth_approval}")
|
||||
public ResponseEntity<?> getAccess(
|
||||
@PathVariable("oauth_approval") String oauth_approval,
|
||||
@ResponseBody
|
||||
public Message<Map<String, Object>> getAccess(
|
||||
@PathVariable("oauth_approval") String oauthApproval,
|
||||
@CurrentUser UserInfo currentUser) {
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
if(authTokenService.validateJwtToken(oauth_approval)) {
|
||||
Map<String, Object> model = new HashMap<>();
|
||||
if(authTokenService.validateJwtToken(oauthApproval)) {
|
||||
try {
|
||||
AuthorizationRequest clientAuth =
|
||||
(AuthorizationRequest) momentaryService.get(currentUser.getSessionId(), "authorizationRequest");
|
||||
@@ -156,7 +155,7 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
model.put("appName", app.getAppName());
|
||||
model.put("iconBase64", app.getIconBase64());
|
||||
model.put("oauth_version", "oauth 2.0");
|
||||
Map<String, String> scopes = new LinkedHashMap<String, String>();
|
||||
Map<String, String> scopes = new LinkedHashMap<>();
|
||||
for (String scope : clientAuth.getScope()) {
|
||||
scopes.put(OAuth2Constants.PARAMETER.SCOPE_PREFIX + scope, "false");
|
||||
}
|
||||
@@ -179,10 +178,10 @@ public class OAuth20AccessConfirmationEndpoint {
|
||||
|
||||
_logger.trace("Confirmation details ");
|
||||
for (Object key : model.keySet()) {
|
||||
_logger.trace("key " + key +"=" + model.get(key));
|
||||
_logger.trace("key {} = {}" ,key,model.get(key));
|
||||
}
|
||||
}
|
||||
return new Message<Map<String, Object>>(model).buildResponse();
|
||||
return new Message<>(model);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
public class BearerTokenExtractor implements TokenExtractor {
|
||||
|
||||
private final static Log logger = LogFactory.getLog(BearerTokenExtractor.class);
|
||||
private static final Log logger = LogFactory.getLog(BearerTokenExtractor.class);
|
||||
|
||||
@Override
|
||||
public Authentication extract(HttpServletRequest request) {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class JdbcClientDetailsService implements ClientDetailsService, ClientReg
|
||||
|
||||
private static final Log logger = LogFactory.getLog(JdbcClientDetailsService.class);
|
||||
|
||||
protected final static Cache<String, ClientDetails> detailsCache =
|
||||
protected static final Cache<String, ClientDetails> detailsCache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
||||
.maximumSize(200000)
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class InMemoryAuthorizationCodeServices extends RandomValueAuthorizationCodeServices {
|
||||
protected final static Cache<String, OAuth2Authentication> authorizationCodeStore =
|
||||
protected static final Cache<String, OAuth2Authentication> authorizationCodeStore =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(3, TimeUnit.MINUTES)
|
||||
.build();
|
||||
|
||||
@@ -61,7 +61,9 @@ import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -96,7 +98,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(AuthorizationEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(AuthorizationEndpoint.class);
|
||||
|
||||
private static final String OAUTH_V20_AUTHORIZATION_URL = "" + OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE + "?client_id=%s&response_type=code&redirect_uri=%s&approval_prompt=auto";
|
||||
|
||||
@@ -118,13 +120,13 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数应用ID,自动完成跳转认证拼接",method="GET")
|
||||
@RequestMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_BASE + "/{id}"},method = RequestMethod.GET)
|
||||
@GetMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_BASE + "/{id}"})
|
||||
public ModelAndView authorize(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@PathVariable("id") String id){
|
||||
ClientDetails clientDetails =getClientDetailsService().loadClientByClientId(id,true);
|
||||
_logger.debug(""+clientDetails);
|
||||
_logger.debug("clientDetails {}",clientDetails);
|
||||
String authorizationUrl = "";
|
||||
try {
|
||||
authorizationUrl = String.format(OAUTH_V20_AUTHORIZATION_URL,
|
||||
@@ -140,11 +142,10 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
@Operation(summary = "OAuth 2.0 认证接口", description = "传递参数client_id,response_type,redirect_uri等",method="GET")
|
||||
@RequestMapping(value = {
|
||||
@GetMapping(value = {
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE,
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_AUTHORIZE
|
||||
},
|
||||
method = RequestMethod.GET)
|
||||
})
|
||||
public ModelAndView authorize(
|
||||
Map<String, Object> model,
|
||||
@RequestParam Map<String, String> parameters,
|
||||
@@ -238,10 +239,9 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
//approval must post
|
||||
@RequestMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE+"/approval"},
|
||||
params = OAuth2Constants.PARAMETER.USER_OAUTH_APPROVAL,
|
||||
method = RequestMethod.POST)
|
||||
public ResponseEntity<?> authorizeApproveOrDeny(
|
||||
@PostMapping(value = {OAuth2Constants.ENDPOINT.ENDPOINT_AUTHORIZE+"/approval"},
|
||||
params = OAuth2Constants.PARAMETER.USER_OAUTH_APPROVAL)
|
||||
public Message< Object> authorizeApproveOrDeny(
|
||||
@RequestParam Map<String, String> approvalParameters,
|
||||
@CurrentUser UserInfo currentUser,
|
||||
SessionStatus sessionStatus) {
|
||||
@@ -281,16 +281,16 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
new UserDeniedAuthorizationException("User denied access"),
|
||||
responseTypes.contains(OAuth2Constants.PARAMETER.TOKEN)
|
||||
)
|
||||
).buildResponse();
|
||||
);
|
||||
}
|
||||
|
||||
if (responseTypes.contains(OAuth2Constants.PARAMETER.TOKEN)) {
|
||||
return new Message< Object>((Object)
|
||||
getImplicitGrantResponse(authorizationRequest)).buildResponse();
|
||||
getImplicitGrantResponse(authorizationRequest));
|
||||
}
|
||||
|
||||
return new Message< Object>((Object)
|
||||
getAuthorizationCodeResponse(authorizationRequest, (Authentication) principal)).buildResponse();
|
||||
getAuthorizationCodeResponse(authorizationRequest, (Authentication) principal));
|
||||
}
|
||||
finally {
|
||||
sessionStatus.setComplete();
|
||||
@@ -341,7 +341,7 @@ public class AuthorizationEndpoint extends AbstractEndpoint {
|
||||
authorizationRequest,
|
||||
generateCode(authorizationRequest, authUser)
|
||||
);
|
||||
_logger.debug("successfulRedirect " + successfulRedirect);
|
||||
_logger.debug("successfulRedirect {}" , successfulRedirect);
|
||||
return successfulRedirect;
|
||||
}
|
||||
catch (OAuth2Exception e) {
|
||||
|
||||
@@ -45,7 +45,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class IntrospectEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(IntrospectEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(IntrospectEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
@@ -41,7 +41,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OauthJwksEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OauthJwksEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OauthJwksEndpoint.class);
|
||||
|
||||
@Operation(summary = "OAuth JWk 元数据接口", description = "参数mxk_metadata_APPID",method="GET")
|
||||
@RequestMapping(
|
||||
|
||||
@@ -86,7 +86,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
OAuth2Constants.ENDPOINT.ENDPOINT_TENCENT_IOA_TOKEN+"/*"})
|
||||
public class TokenEndpointAuthenticationFilter implements Filter {
|
||||
|
||||
final static Logger _logger = LoggerFactory.getLogger(TokenEndpointAuthenticationFilter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(TokenEndpointAuthenticationFilter.class);
|
||||
|
||||
private AuthenticationDetailsSource<HttpServletRequest, ?> authenticationDetailsSource = new WebAuthenticationDetailsSource();
|
||||
boolean allowOnlyPost;
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class OAuthDefaultUserInfoAdapter extends AbstractAuthorizeAdapter {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OAuthDefaultUserInfoAdapter.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OAuthDefaultUserInfoAdapter.class);
|
||||
ClientDetails clientDetails;
|
||||
|
||||
public OAuthDefaultUserInfoAdapter() {}
|
||||
|
||||
@@ -54,7 +54,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class UserInfoEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(UserInfoEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(UserInfoEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
@@ -74,7 +74,7 @@ import com.nimbusds.jwt.SignedJWT;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class UserInfoOIDCEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(UserInfoOIDCEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(UserInfoOIDCEndpoint.class);
|
||||
@Autowired
|
||||
@Qualifier("oauth20JdbcClientDetailsService")
|
||||
private ClientDetailsService clientDetailsService;
|
||||
|
||||
@@ -44,7 +44,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OauthAuthorizationServerEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OauthAuthorizationServerEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OauthAuthorizationServerEndpoint.class);
|
||||
|
||||
@Operation(summary = "OAuth v2 metadata 元数据接口", description = "参数client_id",method="GET,POST")
|
||||
@RequestMapping(
|
||||
|
||||
@@ -38,7 +38,7 @@ import java.util.Set;
|
||||
@Tag(name = "2-1-OAuth v2.0 API文档模块")
|
||||
@Controller
|
||||
public class OpenidConfigurationEndpoint extends AbstractEndpoint {
|
||||
final static Logger _logger = LoggerFactory.getLogger(OpenidConfigurationEndpoint.class);
|
||||
static final Logger _logger = LoggerFactory.getLogger(OpenidConfigurationEndpoint.class);
|
||||
|
||||
|
||||
@Operation(summary = "OpenID Connect metadata 元数据接口", description = "参数client_id",method="GET,POST")
|
||||
|
||||
@@ -62,9 +62,9 @@ import com.nimbusds.jwt.SignedJWT;
|
||||
*
|
||||
*/
|
||||
public class OIDCIdTokenEnhancer implements TokenEnhancer {
|
||||
private final static Logger _logger = LoggerFactory.getLogger(OIDCIdTokenEnhancer.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(OIDCIdTokenEnhancer.class);
|
||||
|
||||
public final static String ID_TOKEN_SCOPE="openid";
|
||||
public static final String ID_TOKEN_SCOPE="openid";
|
||||
|
||||
private OIDCProviderMetadata providerMetadata;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user