Apache CXF API

org.apache.cxf.rs.security.oauth2.utils
Class OAuthUtils

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.utils.OAuthUtils

public final class OAuthUtils
extends Object

Various utility methods


Method Summary
static boolean checkRequestURI(String servletPath, String uri)
           
static String convertPermissionsToScope(List<OAuthPermission> perms)
           
static List<String> convertPermissionsToScopeList(List<OAuthPermission> perms)
           
static UserSubject createSubject(SecurityContext securityContext)
           
static String generateRandomTokenKey()
           
static String generateRandomTokenKey(String digestAlgo)
           
static long getIssuedAt()
           
static List<String> getRequestedScopes(Client client, String scopeParameter, boolean partialMatchScopeValidation)
           
static boolean isExpired(Long issuedAt, Long lifetime)
           
static boolean isGrantSupportedForClient(Client client, boolean canSupportPublicClients, String grantType)
           
static List<String> parseScope(String requestedScope)
           
static boolean validateAudience(String audience, List<String> audiences)
           
static boolean validateScopes(List<String> requestScopes, List<String> registeredScopes, boolean partialMatchScopeValidation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSubject

public static UserSubject createSubject(SecurityContext securityContext)

convertPermissionsToScope

public static String convertPermissionsToScope(List<OAuthPermission> perms)

convertPermissionsToScopeList

public static List<String> convertPermissionsToScopeList(List<OAuthPermission> perms)

isGrantSupportedForClient

public static boolean isGrantSupportedForClient(Client client,
                                                boolean canSupportPublicClients,
                                                String grantType)

parseScope

public static List<String> parseScope(String requestedScope)

generateRandomTokenKey

public static String generateRandomTokenKey()
                                     throws OAuthServiceException
Throws:
OAuthServiceException

getIssuedAt

public static long getIssuedAt()

generateRandomTokenKey

public static String generateRandomTokenKey(String digestAlgo)
                                     throws OAuthServiceException
Throws:
OAuthServiceException

isExpired

public static boolean isExpired(Long issuedAt,
                                Long lifetime)

validateAudience

public static boolean validateAudience(String audience,
                                       List<String> audiences)

checkRequestURI

public static boolean checkRequestURI(String servletPath,
                                      String uri)

getRequestedScopes

public static List<String> getRequestedScopes(Client client,
                                              String scopeParameter,
                                              boolean partialMatchScopeValidation)

validateScopes

public static boolean validateScopes(List<String> requestScopes,
                                     List<String> registeredScopes,
                                     boolean partialMatchScopeValidation)

Apache CXF API

Apache CXF