com.ericdaugherty.mail.server.auth
Class PlainServerMode

java.lang.Object
  extended by com.ericdaugherty.mail.server.auth.PlainServerMode
All Implemented Interfaces:
AuthServerMode, javax.security.sasl.SaslServer
Direct Known Subclasses:
LoginServerMode

public class PlainServerMode
extends java.lang.Object
implements AuthServerMode, javax.security.sasl.SaslServer

Verify client authentication using SASL PLAIN.

Author:
Andreas Kyrmegalos

Nested Class Summary
protected  class PlainServerMode.FinalizeAuthentication
           
protected  class PlainServerMode.FinalizeAuthenticationPOP3
           
protected  class PlainServerMode.FinalizeAuthenticationSMTP
           
 
Field Summary
protected  java.lang.String clientIp
          The IP address of the client
protected  boolean domainNeeded
           
protected  PlainServerMode.FinalizeAuthentication finalizeAuthentication
           
protected  User user
           
protected  boolean userMBLocked
           
 
Constructor Summary
PlainServerMode(boolean isSMTP)
           
 
Method Summary
 void conclude()
           
 void dispose()
           
 byte[] evaluateResponse(byte[] responseBytes)
           
 java.lang.String getAuthorizationID()
           
 java.lang.String getMechanismName()
           
 java.lang.Object getNegotiatedProperty(java.lang.String propName)
           
 User getUser()
           
 boolean isComplete()
           
 boolean isDomainNeeded()
           
 boolean isUserMBLocked()
           
 void setClientIp(java.lang.String clientIp)
           
 byte[] unwrap(byte[] incoming, int start, int len)
           
 byte[] wrap(byte[] outgoing, int start, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientIp

protected java.lang.String clientIp
The IP address of the client


finalizeAuthentication

protected final PlainServerMode.FinalizeAuthentication finalizeAuthentication

user

protected User user

domainNeeded

protected boolean domainNeeded

userMBLocked

protected boolean userMBLocked
Constructor Detail

PlainServerMode

public PlainServerMode(boolean isSMTP)
Method Detail

setClientIp

public void setClientIp(java.lang.String clientIp)

evaluateResponse

public byte[] evaluateResponse(byte[] responseBytes)
                        throws javax.security.sasl.SaslException
Specified by:
evaluateResponse in interface javax.security.sasl.SaslServer
Throws:
javax.security.sasl.SaslException

isDomainNeeded

public boolean isDomainNeeded()

isUserMBLocked

public boolean isUserMBLocked()

getUser

public User getUser()
Specified by:
getUser in interface AuthServerMode

conclude

public void conclude()
Specified by:
conclude in interface AuthServerMode

getMechanismName

public java.lang.String getMechanismName()
Specified by:
getMechanismName in interface javax.security.sasl.SaslServer

unwrap

public byte[] unwrap(byte[] incoming,
                     int start,
                     int len)
              throws javax.security.sasl.SaslException
Specified by:
unwrap in interface javax.security.sasl.SaslServer
Throws:
javax.security.sasl.SaslException

wrap

public byte[] wrap(byte[] outgoing,
                   int start,
                   int len)
            throws javax.security.sasl.SaslException
Specified by:
wrap in interface javax.security.sasl.SaslServer
Throws:
javax.security.sasl.SaslException

dispose

public void dispose()
             throws javax.security.sasl.SaslException
Specified by:
dispose in interface javax.security.sasl.SaslServer
Throws:
javax.security.sasl.SaslException

getNegotiatedProperty

public java.lang.Object getNegotiatedProperty(java.lang.String propName)
Specified by:
getNegotiatedProperty in interface javax.security.sasl.SaslServer

getAuthorizationID

public java.lang.String getAuthorizationID()
Specified by:
getAuthorizationID in interface javax.security.sasl.SaslServer

isComplete

public boolean isComplete()
Specified by:
isComplete in interface javax.security.sasl.SaslServer