Get 'clientName' from 'registrationId'
This commit is contained in:
parent
483a3b847b
commit
d8fecd18d9
@ -40,7 +40,6 @@ public class OAuth2ClientRegistration {
|
|||||||
private String userNameAttributeName;
|
private String userNameAttributeName;
|
||||||
private String jwkSetUri;
|
private String jwkSetUri;
|
||||||
private String clientAuthenticationMethod;
|
private String clientAuthenticationMethod;
|
||||||
private String clientName;
|
|
||||||
private String loginButtonLabel;
|
private String loginButtonLabel;
|
||||||
private String loginButtonIcon;
|
private String loginButtonIcon;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,13 +39,13 @@ public class HybridClientRegistrationRepository implements ClientRegistrationRep
|
|||||||
|
|
||||||
private ClientRegistration toSpringClientRegistration(String redirectUriTemplate, OAuth2ClientRegistration localClientRegistration){
|
private ClientRegistration toSpringClientRegistration(String redirectUriTemplate, OAuth2ClientRegistration localClientRegistration){
|
||||||
return ClientRegistration.withRegistrationId(localClientRegistration.getRegistrationId())
|
return ClientRegistration.withRegistrationId(localClientRegistration.getRegistrationId())
|
||||||
|
.clientName(localClientRegistration.getRegistrationId())
|
||||||
.clientId(localClientRegistration.getClientId())
|
.clientId(localClientRegistration.getClientId())
|
||||||
.authorizationUri(localClientRegistration.getAuthorizationUri())
|
.authorizationUri(localClientRegistration.getAuthorizationUri())
|
||||||
.clientSecret(localClientRegistration.getClientSecret())
|
.clientSecret(localClientRegistration.getClientSecret())
|
||||||
.tokenUri(localClientRegistration.getAccessTokenUri())
|
.tokenUri(localClientRegistration.getAccessTokenUri())
|
||||||
.redirectUriTemplate(redirectUriTemplate)
|
.redirectUriTemplate(redirectUriTemplate)
|
||||||
.scope(localClientRegistration.getScope())
|
.scope(localClientRegistration.getScope())
|
||||||
.clientName(localClientRegistration.getClientName())
|
|
||||||
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
||||||
.userInfoUri(localClientRegistration.getUserInfoUri())
|
.userInfoUri(localClientRegistration.getUserInfoUri())
|
||||||
.userNameAttributeName(localClientRegistration.getUserNameAttributeName())
|
.userNameAttributeName(localClientRegistration.getUserNameAttributeName())
|
||||||
|
|||||||
@ -521,9 +521,6 @@ public class OAuth2ServiceImpl implements OAuth2Service {
|
|||||||
if (StringUtils.isEmpty(clientRegistration.getClientAuthenticationMethod())) {
|
if (StringUtils.isEmpty(clientRegistration.getClientAuthenticationMethod())) {
|
||||||
throw new DataValidationException("Client authentication method should be specified!");
|
throw new DataValidationException("Client authentication method should be specified!");
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(clientRegistration.getClientName())) {
|
|
||||||
throw new DataValidationException("Client name should be specified!");
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(clientRegistration.getLoginButtonLabel())) {
|
if (StringUtils.isEmpty(clientRegistration.getLoginButtonLabel())) {
|
||||||
throw new DataValidationException("Login button label should be specified!");
|
throw new DataValidationException("Login button label should be specified!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -493,7 +493,6 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest {
|
|||||||
.userNameAttributeName("userNameAttributeName")
|
.userNameAttributeName("userNameAttributeName")
|
||||||
.jwkSetUri("jwkSetUri")
|
.jwkSetUri("jwkSetUri")
|
||||||
.clientAuthenticationMethod("clientAuthenticationMethod")
|
.clientAuthenticationMethod("clientAuthenticationMethod")
|
||||||
.clientName("clientName")
|
|
||||||
.loginButtonLabel("loginButtonLabel")
|
.loginButtonLabel("loginButtonLabel")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user