JWT_BEARER flow
parent
198fd7ae4d
commit
5e61dab461
|
@ -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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue