public final class OAuthContextUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertClient(MessageContext mc,
String client) |
static void |
assertRole(MessageContext mc,
String role) |
static OAuthContext |
getContext(MessageContext mc) |
static boolean |
isUserInRole(MessageContext mc,
String role) |
static String |
resolveClient(MessageContext mc) |
static List<OAuthPermission> |
resolvePermissions(MessageContext mc) |
static String |
resolveTokenKey(MessageContext mc) |
static String |
resolveUserId(MessageContext mc) |
static String |
resolveUserName(MessageContext mc) |
static List<String> |
resolveUserRoles(MessageContext mc) |
public static String resolveUserId(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveUserName(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static List<String> resolveUserRoles(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static boolean isUserInRole(MessageContext mc, String role)
mc - the MessageContextrole - the user role to checkWebApplicationException - with Status 401 if not authenticatedpublic static void assertRole(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(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveTokenKey(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static String resolveClient(MessageContext mc)
mc - the MessageContextWebApplicationException - with Status 401 if not authenticatedpublic static void assertClient(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(MessageContext mc)
mc - the MessageContextOAuthContext of the given MessageContextWebApplicationException - with Status 401 if not authenticatedApache CXF