org.springframework.security.oauth2.common.util
Class OAuth2Utils

java.lang.Object
  extended by org.springframework.security.oauth2.common.util.OAuth2Utils

public abstract class OAuth2Utils
extends Object

Author:
Ryan Heaton, Dave Syer

Field Summary
static String CLIENT_ID
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String GRANT_TYPE
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String REDIRECT_URI
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String RESPONSE_TYPE
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String SCOPE
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String SCOPE_PREFIX
          Constant to use as a prefix for scope approval
static String STATE
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
static String USER_OAUTH_APPROVAL
          Constant to use while parsing and formatting parameter maps for OAuth2 requests
 
Constructor Summary
OAuth2Utils()
           
 
Method Summary
static boolean containsAll(Set<String> target, Set<String> members)
          Compare 2 sets and check that one contains all members of the other.
static Map<String,String> extractMap(String query)
          Extract a map from a query string.
static String formatParameterList(Collection<String> value)
          Formats a set of string values into a format appropriate for sending as a single-valued form value.
static Set<String> parseParameterList(String values)
          Parses a string parameter value into a set of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_ID

public static final String CLIENT_ID
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

STATE

public static final String STATE
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

SCOPE

public static final String SCOPE
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

REDIRECT_URI

public static final String REDIRECT_URI
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

RESPONSE_TYPE

public static final String RESPONSE_TYPE
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

USER_OAUTH_APPROVAL

public static final String USER_OAUTH_APPROVAL
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values

SCOPE_PREFIX

public static final String SCOPE_PREFIX
Constant to use as a prefix for scope approval

See Also:
Constant Field Values

GRANT_TYPE

public static final String GRANT_TYPE
Constant to use while parsing and formatting parameter maps for OAuth2 requests

See Also:
Constant Field Values
Constructor Detail

OAuth2Utils

public OAuth2Utils()
Method Detail

parseParameterList

public static Set<String> parseParameterList(String values)
Parses a string parameter value into a set of strings.

Parameters:
values - The values of the set.
Returns:
The set.

formatParameterList

public static String formatParameterList(Collection<String> value)
Formats a set of string values into a format appropriate for sending as a single-valued form value.

Parameters:
value - The value of the parameter.
Returns:
The value formatted for form submission etc, or null if the input is empty

extractMap

public static Map<String,String> extractMap(String query)
Extract a map from a query string.

Parameters:
query - a query (or fragment) string from a URI
Returns:
a Map of the values in the query

containsAll

public static boolean containsAll(Set<String> target,
                                  Set<String> members)
Compare 2 sets and check that one contains all members of the other.

Parameters:
target - set of strings to check
members - the members to compare to
Returns:
true if all members are in the target


Copyright © 2013. All rights reserved.