Class AnonymousUserSecurityContext

java.lang.Object
org.openhab.core.io.rest.auth.AnonymousUserSecurityContext
All Implemented Interfaces:
javax.ws.rs.core.SecurityContext

@NonNullByDefault public class AnonymousUserSecurityContext extends Object implements javax.ws.rs.core.SecurityContext
This SecurityContext can be used to give anonymous users (i.e. unauthenticated requests) the "user" role.
Author:
Yannick Schaus - initial contribution
  • Constructor Details

    • AnonymousUserSecurityContext

      public AnonymousUserSecurityContext()
  • Method Details

    • getUserPrincipal

      public @Nullable Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface javax.ws.rs.core.SecurityContext
    • isUserInRole

      public boolean isUserInRole(@Nullable String role)
      Specified by:
      isUserInRole in interface javax.ws.rs.core.SecurityContext
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface javax.ws.rs.core.SecurityContext
    • getAuthenticationScheme

      public @Nullable String getAuthenticationScheme()
      Specified by:
      getAuthenticationScheme in interface javax.ws.rs.core.SecurityContext