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 TypeMethodDescriptionboolean
hasRealmRole
(String role) boolean
hasResourceRole
(String role, String resource) default boolean
hasResourceRoleOrIsSuperUser
(String role, String resource) default boolean
isRealmAccessibleByUser
(String realm) default boolean
-
Method Details
-
getAuthenticatedRealmName
String getAuthenticatedRealmName() -
getUsername
String getUsername() -
getUserId
String getUserId() -
getClientId
String getClientId() -
isSuperUser
default boolean isSuperUser()- Returns:
true
if the user is authenticated in the "master" realm and has the realm role "admin".
-
hasRealmRole
-
hasResourceRole
-
hasResourceRoleOrIsSuperUser
-
isRealmAccessibleByUser
- Returns:
true
if the user is authenticated in the same realm or if the user is the superuser (admin).
-