From 71fa796b42020ff6eea48c4ca1f8908270e9764c Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 9 Jun 2014 15:55:06 -0400 Subject: [PATCH] Allow public clients to use token endpoint, closes #611, closes #613 --- .../oauth2/service/impl/DefaultClientUserDetailsService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/service/impl/DefaultClientUserDetailsService.java b/openid-connect-common/src/main/java/org/mitre/oauth2/service/impl/DefaultClientUserDetailsService.java index 0fd915209..bb4190fd0 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/service/impl/DefaultClientUserDetailsService.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/service/impl/DefaultClientUserDetailsService.java @@ -30,6 +30,8 @@ import org.springframework.security.oauth2.provider.ClientDetails; import org.springframework.security.oauth2.provider.ClientDetailsService; import org.springframework.stereotype.Service; +import com.google.common.base.Strings; + /** * Shim layer to convert a ClientDetails service into a UserDetails service * @@ -49,7 +51,7 @@ public class DefaultClientUserDetailsService implements UserDetailsService { if (client != null) { - String password = client.getClientSecret(); + String password = Strings.nullToEmpty(client.getClientSecret()); boolean enabled = true; boolean accountNonExpired = true; boolean credentialsNonExpired = true;