Interface IdPSession

    • Field Detail

      • MDC_ATTRIBUTE

        static final String MDC_ATTRIBUTE
        Name of MDC attribute that holds the current session ID: idp.session.id.
        See Also:
        Constant Field Values
    • Method Detail

      • getPrincipalName

        @Nonnull
        @NotEmpty
        String getPrincipalName()
        Get the canonical principal name for the session.
        Returns:
        the principal name
      • getCreationInstant

        @Nonnull
        Instant getCreationInstant()
        Get the time when this session was created.
        Returns:
        time this session was created
      • getLastActivityInstant

        @Nonnull
        Instant getLastActivityInstant()
        Get the last activity instant for the session.
        Returns:
        last activity instant for the session
      • checkAddress

        boolean checkAddress​(@Nonnull @NotEmpty
                             String address)
                      throws SessionException
        Test the session's validity based on the supplied client address, possibly binding it to the session if appropriate.
        Parameters:
        address - client address for validation
        Returns:
        true iff the session is valid for the specified client address
        Throws:
        SessionException - if an error occurs binding the address to the session
      • checkTimeout

        boolean checkTimeout()
                      throws SessionException
        Test the session's validity based on inactivity, while updating the last activity time.
        Returns:
        true iff the session is still valid
        Throws:
        SessionException - if an error occurs updating the activity time
      • removeAuthenticationResult

        boolean removeAuthenticationResult​(@Nonnull
                                           AuthenticationResult result)
                                    throws SessionException
        Disassociate an AuthenticationResult from this IdP session.
        Parameters:
        result - the result to disassociate
        Returns:
        true iff the given result had been associated with this IdP session and now is not
        Throws:
        SessionException - if an error occurs accessing the session
      • getSPSessions

        @Nonnull
        @NonnullElements
        @NotLive
        @Unmodifiable
        Set<SPSession> getSPSessions()
        Gets the unmodifiable collection of service sessions associated with this session.
        Returns:
        unmodifiable collection of service sessions associated with this session
      • getSPSession

        @Nullable
        SPSession getSPSession​(@Nonnull @NotEmpty
                               String serviceId)
        Get the SPSession for a given service.
        Parameters:
        serviceId - ID of the service
        Returns:
        the session service or null if no session exists for that service, may be null
      • addSPSession

        @Nullable
        SPSession addSPSession​(@Nonnull
                               SPSession spSession)
                        throws SessionException
        Add a new SP session to this IdP session, replacing any existing session for the same service.
        Parameters:
        spSession - the SP session
        Returns:
        a previously existing SPSession replaced by the new one, if any
        Throws:
        SessionException - if an error occurs accessing the session
      • removeSPSession

        boolean removeSPSession​(@Nonnull
                                SPSession spSession)
                         throws SessionException
        Disassociate the given SP session from this IdP session.
        Parameters:
        spSession - the SP session
        Returns:
        true iff the given SP session had been associated with this IdP session and now is not
        Throws:
        SessionException - if an error occurs accessing the SP session