|
|
|
@ -21,11 +21,13 @@ import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
|
import java.io.Serializable; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.LinkedHashSet; |
|
|
|
import java.util.LinkedHashSet; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* A representation of an <i>OAuth 2.0 Authorization Request</i> |
|
|
|
* A representation of an <i>OAuth 2.0 Authorization Request</i> |
|
|
|
@ -127,6 +129,14 @@ public final class AuthorizationRequest implements Serializable { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Builder scope(String... scope) { |
|
|
|
|
|
|
|
if (scope != null && scope.length > 0) { |
|
|
|
|
|
|
|
return this.scopes(Arrays.stream(scope).collect( |
|
|
|
|
|
|
|
Collectors.toCollection(LinkedHashSet::new))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Builder scopes(Set<String> scopes) { |
|
|
|
public Builder scopes(Set<String> scopes) { |
|
|
|
this.scopes = scopes; |
|
|
|
this.scopes = scopes; |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
|