Interface AuthContext
- All Known Implementing Classes:
AccessTokenAuthContext,BasicAuthContext,WebResource
public interface AuthContext
Services should use this interface to access a user's identity and perform authorization checks.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasRealmRole(String role) booleanhasResourceRole(String role, String resource) default booleanhasResourceRoleOrIsSuperUser(String role, String resource) default booleanisRealmAccessibleByUser(String realm) default boolean
-
Method Details
-
getAuthenticatedRealmName
String getAuthenticatedRealmName() -
getUsername
String getUsername() -
getUserId
String getUserId() -
getClientId
String getClientId() -
isSuperUser
default boolean isSuperUser()- Returns:
trueif the user is authenticated in the "master" realm and has the realm role "admin".
-
hasRealmRole
-
hasResourceRole
-
hasResourceRoleOrIsSuperUser
-
isRealmAccessibleByUser
- Returns:
trueif the user is authenticated in the same realm or if the user is the superuser (admin).
-