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 jwkSetUri;
|
||||
private String clientAuthenticationMethod;
|
||||
private String clientName;
|
||||
private String loginButtonLabel;
|
||||
private String loginButtonIcon;
|
||||
}
|
||||
|
||||
@ -39,13 +39,13 @@ public class HybridClientRegistrationRepository implements ClientRegistrationRep
|
||||
|
||||
private ClientRegistration toSpringClientRegistration(String redirectUriTemplate, OAuth2ClientRegistration localClientRegistration){
|
||||
return ClientRegistration.withRegistrationId(localClientRegistration.getRegistrationId())
|
||||
.clientName(localClientRegistration.getRegistrationId())
|
||||
.clientId(localClientRegistration.getClientId())
|
||||
.authorizationUri(localClientRegistration.getAuthorizationUri())
|
||||
.clientSecret(localClientRegistration.getClientSecret())
|
||||
.tokenUri(localClientRegistration.getAccessTokenUri())
|
||||
.redirectUriTemplate(redirectUriTemplate)
|
||||
.scope(localClientRegistration.getScope())
|
||||
.clientName(localClientRegistration.getClientName())
|
||||
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
|
||||
.userInfoUri(localClientRegistration.getUserInfoUri())
|
||||
.userNameAttributeName(localClientRegistration.getUserNameAttributeName())
|
||||
|
||||
@ -521,9 +521,6 @@ public class OAuth2ServiceImpl implements OAuth2Service {
|
||||
if (StringUtils.isEmpty(clientRegistration.getClientAuthenticationMethod())) {
|
||||
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())) {
|
||||
throw new DataValidationException("Login button label should be specified!");
|
||||
}
|
||||
|
||||
@ -493,7 +493,6 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest {
|
||||
.userNameAttributeName("userNameAttributeName")
|
||||
.jwkSetUri("jwkSetUri")
|
||||
.clientAuthenticationMethod("clientAuthenticationMethod")
|
||||
.clientName("clientName")
|
||||
.loginButtonLabel("loginButtonLabel")
|
||||
.build();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user