示例#1
0
        public AfpResultCode Process(IAfpSession session, DsiHeader dsiHeader, AfpStream requestStream, AfpStream responseStream)
        {
            requestStream.ReadUInt8();  // Padding
            requestStream.ReadUInt16(); // Read unused flags

            string version = requestStream.ReadPascalString();
            string uam     = requestStream.ReadPascalString();

            requestStream.ReadUInt8(); // User type always 3

            string userName = requestStream.ReadUTF8String();

            requestStream.ReadUInt8();

            string pathname = requestStream.ReadUTF8String();

            requestStream.ReadPadding();

            IAfpUserAuthenticationMethod method = session.Server.GetAuthenticationMethod(uam);

            if (method == null)
            {
                return(AfpResultCode.FPBadUAM);
            }

            session.AuthenticationMethod = method;

            AfpUserAuthenticationResult result = method.Authenticate(session, version, pathname, userName, requestStream);

            return(result.Execute(session, responseStream));
        }
示例#2
0
        public AfpResultCode Process(IAfpSession session, DsiHeader dsiHeader, AfpStream requestStream, AfpStream responseStream)
        {
            string version = requestStream.ReadPascalString();
            string uam     = requestStream.ReadPascalString();

            IAfpUserAuthenticationMethod method = session.Server.GetAuthenticationMethod(uam);

            if (method == null)
            {
                return(AfpResultCode.FPBadUAM);
            }

            AfpUserAuthenticationResult result = method.Authenticate(session, version, null, null, requestStream);

            return(result.Execute(session, responseStream));
        }