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 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

      boolean hasRealmRole(String role)
    • hasResourceRole

      boolean hasResourceRole(String role, String resource)
    • hasResourceRoleOrIsSuperUser

      default boolean hasResourceRoleOrIsSuperUser(String role, String resource)
    • isRealmAccessibleByUser

      default boolean isRealmAccessibleByUser(String realm)
      Returns:
      true if the user is authenticated in the same realm or if the user is the superuser (admin).