Interface SecurityServices

All Superinterfaces:
Service

public interface SecurityServices extends Service
Responsible for accessing security related functionality the environment can provide.

Required in a Java EE environment. SecurityServices is a per-deployment service.

An integrator should either implement getSecurityContext() or getSecurityContextAssociator(). By default, the getSecurityContextAssociator() method delegates to getSecurityContext(). The container always calls the getSecurityContextAssociator() method.

Author:
pmuir, Jozef Hartinger
  • Method Summary

    Modifier and Type
    Method
    Description
    Obtain the Principal representing the current caller identity
    Obtain the security context associated with the current thread.
    Obtain the security context associated with the current thread and associate this context when an action is performed.

    Methods inherited from interface org.jboss.weld.bootstrap.api.Service

    cleanup
  • Method Details

    • getPrincipal

      Principal getPrincipal()
      Obtain the Principal representing the current caller identity
      Returns:
      the Principal representing the current caller identity
    • getSecurityContext

      default SecurityContext getSecurityContext()
      Obtain the security context associated with the current thread. This method is used by Weld to propagate the security context of the current thread to different threads.

      By default, a noop fallback implementation is returned.

      Returns:
      the security context associated with the current thread
      Since:
      3.0
    • getSecurityContextAssociator

      default Consumer<Runnable> getSecurityContextAssociator()
      Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to different threads.

      By default, the consumer is using getSecurityContext() to associate the security context.

      Returns:
      a consumer that accepts an action to be performed with the security context associated with the current thread