JWT_BEARER flow

pull/4/head
shengzhaoli.shengz 2023-10-24 10:21:08 +08:00
parent 198fd7ae4d
commit 5e61dab461
2 changed files with 7 additions and 1 deletions

View File

@ -28,5 +28,10 @@ public interface SOSConstants {
*/ */
String AUTHORIZATION_ENDPOINT_URI = "/oauth2/authorize"; String AUTHORIZATION_ENDPOINT_URI = "/oauth2/authorize";
/**
* HS256
* MacAlgorithm.java
*/
String HS = "HS";
} }

View File

@ -10,6 +10,7 @@ import org.springframework.security.oauth2.server.authorization.settings.ClientS
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import static com.monkeyk.sos.domain.shared.SOSConstants.HS;
import static org.springframework.security.oauth2.jose.jws.JwsAlgorithms.RS256; import static org.springframework.security.oauth2.jose.jws.JwsAlgorithms.RS256;
/** /**
@ -75,7 +76,7 @@ public class ClientSettingsDto implements Serializable {
.requireProofKey(requireProofKey) .requireProofKey(requireProofKey)
.requireAuthorizationConsent(requireAuthorizationConsent); .requireAuthorizationConsent(requireAuthorizationConsent);
//区分不同算法:对称/非对称 //区分不同算法:对称/非对称
if (tokenEndpointAuthenticationSigningAlgorithm.startsWith("HS")) { if (tokenEndpointAuthenticationSigningAlgorithm.startsWith(HS)) {
builder.tokenEndpointAuthenticationSigningAlgorithm(MacAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm)); builder.tokenEndpointAuthenticationSigningAlgorithm(MacAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm));
} else { } else {
builder.tokenEndpointAuthenticationSigningAlgorithm(SignatureAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm)); builder.tokenEndpointAuthenticationSigningAlgorithm(SignatureAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm));