1
0
mirror of synced 2026-08-06 02:08:01 +00:00

Add ClientRegistration from OpenID Connect Discovery

Fixes: gh-4413
This commit is contained in:
Rob Winch
2018-05-16 12:28:31 -05:00
parent e82a1d151c
commit 0598d47732
4 changed files with 343 additions and 0 deletions
@@ -21,6 +21,7 @@ import org.springframework.security.oauth2.core.oidc.OidcScopes;
import org.springframework.util.Assert;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -324,6 +325,20 @@ public final class ClientRegistration {
return this;
}
/**
* Sets the scope(s) used for the client.
*
* @param scope the scope(s) used for the client
* @return the {@link Builder}
*/
public Builder scope(Collection<String> scope) {
if (scope != null && !scope.isEmpty()) {
this.scopes = Collections.unmodifiableSet(
new LinkedHashSet<>(scope));
}
return this;
}
/**
* Sets the uri for the authorization endpoint.
*