java.lang.Object
net.i2p.sam.SAMSecureSession
All Implemented Interfaces:
SAMSecureSessionInterface

public class SAMSecureSessionextends Object implements SAMSecureSessionInterface
This is the "default" implementation of the SAMSecureSession @interface that behaves exactly like SAM without interactive authentication. It uses the i2cp username and password properties for authentication. Implementers can add their own means of authentication by substituting this interface for their own.
  • Field Details

    • log

      private final Log log
      Logger for this class.
  • Constructor Details

    • SAMSecureSession

      public SAMSecureSession()
      The only field is the logger, which the field initialiser takes from the global context, so a bare instance is ready to authenticate.
  • Method Details

    • approveOrDenySecureSession

      public boolean approveOrDenySecureSession(Properties i2cpProps, Properties props) throws SAMException
      Authenticate based on the i2cp username/password.
      Specified by:
      approveOrDenySecureSession in interface SAMSecureSessionInterface
      Parameters:
      i2cpProps - the I2CP session properties
      props - the SAM connection properties containing USER and PASSWORD
      Returns:
      true if authentication succeeds
      Throws:
      SAMException - if USER/PASSWORD not provided or authentication fails