|
|
@ -3,6 +3,7 @@ package com.monkeyk.sos.service.dto;
|
|
|
|
import com.monkeyk.sos.infrastructure.SettingsUtils;
|
|
|
|
import com.monkeyk.sos.infrastructure.SettingsUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.security.oauth2.jose.jws.JwsAlgorithm;
|
|
|
|
import org.springframework.security.oauth2.jose.jws.JwsAlgorithm;
|
|
|
|
|
|
|
|
import org.springframework.security.oauth2.jose.jws.MacAlgorithm;
|
|
|
|
import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm;
|
|
|
|
import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm;
|
|
|
|
import org.springframework.security.oauth2.server.authorization.settings.ClientSettings;
|
|
|
|
import org.springframework.security.oauth2.server.authorization.settings.ClientSettings;
|
|
|
|
|
|
|
|
|
|
|
@ -72,8 +73,13 @@ public class ClientSettingsDto implements Serializable {
|
|
|
|
public ClientSettings toSettings() {
|
|
|
|
public ClientSettings toSettings() {
|
|
|
|
ClientSettings.Builder builder = ClientSettings.builder()
|
|
|
|
ClientSettings.Builder builder = ClientSettings.builder()
|
|
|
|
.requireProofKey(requireProofKey)
|
|
|
|
.requireProofKey(requireProofKey)
|
|
|
|
.requireAuthorizationConsent(requireAuthorizationConsent)
|
|
|
|
.requireAuthorizationConsent(requireAuthorizationConsent);
|
|
|
|
.tokenEndpointAuthenticationSigningAlgorithm(SignatureAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm));
|
|
|
|
//区分不同算法:对称/非对称
|
|
|
|
|
|
|
|
if (tokenEndpointAuthenticationSigningAlgorithm.startsWith("HS")) {
|
|
|
|
|
|
|
|
builder.tokenEndpointAuthenticationSigningAlgorithm(MacAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
builder.tokenEndpointAuthenticationSigningAlgorithm(SignatureAlgorithm.valueOf(tokenEndpointAuthenticationSigningAlgorithm));
|
|
|
|
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotBlank(jwkSetUrl)) {
|
|
|
|
if (StringUtils.isNotBlank(jwkSetUrl)) {
|
|
|
|
builder.jwkSetUrl(jwkSetUrl);
|
|
|
|
builder.jwkSetUrl(jwkSetUrl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|