Class ClientSecurityContext

    • Constructor Detail

      • ClientSecurityContext

        public ClientSecurityContext​(String username,
                                     Subject subject)
        This creates a new ClientSecurityContext object.
        Parameters:
        The - name of the user.
        The - Credentials of the user.
    • Method Detail

      • getCurrent

        public static ClientSecurityContext getCurrent()
        This method gets the SecurityContext stored here. If using a per-thread authentication model, it gets the context from Thread Local Store (TLS) of the current thread. If not using a per-thread authentication model, it gets the singleton context.
        Returns:
        The current Security Context stored here. It returns null if SecurityContext could not be found.
      • setCurrent

        public static void setCurrent​(ClientSecurityContext clientSecurityContext)
        This method sets the SecurityContext to be stored here.
        Parameters:
        The - Security Context that should be stored.
      • hasEmtpyCredentials

        public static boolean hasEmtpyCredentials​(ClientSecurityContext clientSecurityContext)
      • getCurrentSecurityContext

        public AppServSecurityContext getCurrentSecurityContext()
        Returns:
        the current security context
      • setUnauthenticatedSecurityContext

        public void setUnauthenticatedSecurityContext()
        Description copied from interface: AppServSecurityContext
        set the unauthenticated context
      • setSecurityContextWithPrincipal

        public void setSecurityContextWithPrincipal​(Principal principal)
        Description copied from interface: AppServSecurityContext
        set the SecurityContext with given Principal