Class SecurityContextUtil

  • All Implemented Interfaces:
    org.glassfish.hk2.api.PostConstruct

    @Service
    @Singleton
    public class SecurityContextUtil
    extends Object
    implements org.glassfish.hk2.api.PostConstruct
    This class provides has the helper methods to deal with the SecurityContext. This represents the SecurityServiceImpl of V2
    Author:
    Nithya Subramanian
    • Constructor Detail

      • SecurityContextUtil

        public SecurityContextUtil()
    • Method Detail

      • postConstruct

        public void postConstruct()
        Specified by:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • receivedReply

        public static void receivedReply​(int reply_status,
                                         org.omg.CORBA.Object effective_target)
        This is called by the CSIv2 interceptor on the client after a reply is received.
        Parameters:
        the - reply status from the call. The reply status field could indicate an authentication retry. The following is the mapping of PI status to the reply_status field PortableInterceptor::SUCCESSFUL -> STATUS_PASSED PortableInterceptor::SYSTEM_EXCEPTION -> STATUS_FAILED PortableInterceptor::USER_EXCEPTION -> STATUS_PASSED PortableInterceptor::LOCATION_FORWARD -> STATUS_RETRY PortableInterceptor::TRANSPORT_RETRY -> STATUS_RETRY
        the - effective_target field of the PI ClientRequestInfo object.
      • setSecurityContext

        public int setSecurityContext​(SecurityContext context,
                                      byte[] objectId,
                                      String method,
                                      Socket socket)
        This is called by the CSIv2 interceptor on the server after receiving the IIOP message. If authentication fails a FAILED status is returned. If a FAILED status is returned the CSIV2 Intercepter will marshal the MessageError service context and throw the NO_PERMISSION exception.
        Parameters:
        the - SecurityContext which arrived in the IIOP message.
        Returns:
        the status
      • sendingReply

        public void sendingReply​(SecurityContext context)
        This is called by the CSIv2 interceptor on the server before sending the reply.
        Parameters:
        the - SecurityContext which arrived in the IIOP message.
      • unsetSecurityContext

        public static void unsetSecurityContext​(boolean isLocal)
        This is called on the server to unset the security context this is introduced to prevent the re-use of the thread security context on re-use of the thread.