com.nimbusds.oauth2.sdk
Class Scope
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<ScopeToken>
com.nimbusds.oauth2.sdk.Scope
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<ScopeToken>, Collection<ScopeToken>, Set<ScopeToken>
@NotThreadSafe
public class Scope
- extends HashSet<ScopeToken>
Authorisation scope. This class is not thread-safe.
Example scope from OpenID Connect indicating access to the user's email
and profile details:
Scope scope = new Scope();
scope.add(OIDCScopeToken.OPENID);
scope.add(OIDCScopeToken.EMAIL);
scope.add(OIDCScopeToken.PROFILE);
Related specifications:
- OAuth 2.0 (RFC 6749), section 3.3.
- Version:
- $version$ (2013-01-19)
- Author:
- Vladimir Dzhuvinov
- See Also:
- Serialized Form
Constructor Summary |
Scope()
Creates a new empty authorisation scope. |
Method Summary |
static Scope |
parse(String s)
Parses a scope from the specified string representation. |
String |
toString()
Returns the string representation of this scope. |
Scope
public Scope()
- Creates a new empty authorisation scope.
toString
public String toString()
- Returns the string representation of this scope. The scope tokens
can be serialised in any order.
- Overrides:
toString
in class AbstractCollection<ScopeToken>
- Returns:
- The string representation.
parse
public static Scope parse(String s)
- Parses a scope from the specified string representation.
- Parameters:
s
- The scope string, null
if not specified.
- Returns:
- The scope,
null
if not specified.
Copyright © 2013 NimbusDS. All Rights Reserved.