public final class OAuthContextUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertClient(org.apache.cxf.jaxrs.ext.MessageContext mc,
String client) |
static void |
assertRole(org.apache.cxf.jaxrs.ext.MessageContext mc,
String role) |
static OAuthContext |
getContext(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static boolean |
isUserInRole(org.apache.cxf.jaxrs.ext.MessageContext mc,
String role) |
static String |
resolveClient(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static List<OAuthPermission> |
resolvePermissions(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static String |
resolveTokenKey(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static String |
resolveUserId(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static String |
resolveUserName(org.apache.cxf.jaxrs.ext.MessageContext mc) |
static List<String> |
resolveUserRoles(org.apache.cxf.jaxrs.ext.MessageContext mc) |
public static String resolveUserId(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveUserName(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static List<String> resolveUserRoles(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static boolean isUserInRole(org.apache.cxf.jaxrs.ext.MessageContext mc,
String role)
mc - the MessageContextrole - the user role to checkWebApplicationException - with Status 401 if not authenticatedpublic static void assertRole(org.apache.cxf.jaxrs.ext.MessageContext mc,
String role)
mc - the MessageContextrole - the role to checkWebApplicationException - with Status 401 if not authenticatedWebApplicationException - with Status 403 if user doesn't have needed rolepublic static List<OAuthPermission> resolvePermissions(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveTokenKey(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveClient(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static void assertClient(org.apache.cxf.jaxrs.ext.MessageContext mc,
String client)
mc - the MessageContextclient - the desired client registration idWebApplicationException - with Status 403 if the current client id is not validpublic static OAuthContext getContext(org.apache.cxf.jaxrs.ext.MessageContext mc)
mc - the MessageContextOAuthContext of the given MessageContextWebApplicationException - with Status 401 if not authenticatedApache CXF