private void OnAuthenticate(PassportAuthenticationEventArgs e)
 {
     if (this._eventHandler != null)
     {
         this._eventHandler(this, e);
         if ((e.Context.User == null) && (e.User != null))
         {
             InternalSecurityPermissions.ControlPrincipal.Demand();
             e.Context.User = e.User;
         }
     }
     if (e.Context.User == null)
     {
         InternalSecurityPermissions.ControlPrincipal.Demand();
         e.Context.User = new PassportPrincipal(e.Identity, new string[0]);
     }
 }
Пример #2
0
 private void OnAuthenticate(PassportAuthenticationEventArgs e)
 {
     if (this._eventHandler != null)
     {
         this._eventHandler(this, e);
         if ((e.Context.User == null) && (e.User != null))
         {
             InternalSecurityPermissions.ControlPrincipal.Demand();
             e.Context.User = e.User;
         }
     }
     if (e.Context.User == null)
     {
         InternalSecurityPermissions.ControlPrincipal.Demand();
         e.Context.User = new PassportPrincipal(e.Identity, new string[0]);
     }
 }
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a PassportIdentity
        /// <include file='doc\PassportAuthenticationModule.uex' path='docs/doc[@for="PassportAuthenticationModule.OnAuthenticate"]/*' />
        /// <devdoc>
        ///    Calls the
        ///    PassportAuthentication_OnAuthenticate handler, if one exists.
        /// </devdoc>
        void OnAuthenticate(PassportAuthenticationEventArgs e)
        {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null)
            {
                _eventHandler(this, e);
                if (e.Context.User == null && e.User != null)
                {
                    e.Context.User = e.User;
                }
            }

            ////////////////////////////////////////////////////////////
            // Default Implementation: If IPrincipal has not been created,
            //                         create a PassportUser
            if (e.Context.User == null)
            {
                e.Context.User = new GenericPrincipal(e.Identity, new String[0]);
            }
        }
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a PassportIdentity

        /// <devdoc>
        ///    Calls the
        ///    PassportAuthentication_OnAuthenticate handler, if one exists.
        /// </devdoc>
        void OnAuthenticate(PassportAuthenticationEventArgs e)
        {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null)
            {
                _eventHandler(this, e);
                if (e.Context.User == null && e.User != null)
                {
                    InternalSecurityPermissions.ControlPrincipal.Demand();
                    e.Context.User = e.User;
                }
            }

            ////////////////////////////////////////////////////////////
            // Default Implementation: If IPrincipal has not been created,
            //                         create a PassportUser
            if (e.Context.User == null)
            {
                InternalSecurityPermissions.ControlPrincipal.Demand();
                e.Context.User = new PassportPrincipal(e.Identity, new String[0]);
            }
        }
		private void Authenticate (object sender, PassportAuthenticationEventArgs e)
		{
		}
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a PassportIdentity

        /// <devdoc>
        ///    Calls the
        ///    PassportAuthentication_OnAuthenticate handler, if one exists.
        /// </devdoc>
        void OnAuthenticate(PassportAuthenticationEventArgs e) {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null) {
                _eventHandler(this, e);
                if (e.Context.User == null && e.User != null)
                {
                    InternalSecurityPermissions.ControlPrincipal.Demand();
                    e.Context.User = e.User;
                }
            }

            ////////////////////////////////////////////////////////////
            // Default Implementation: If IPrincipal has not been created,
            //                         create a PassportUser
            if (e.Context.User == null)
            {
                InternalSecurityPermissions.ControlPrincipal.Demand();
                e.Context.User = new PassportPrincipal(e.Identity, new String[0]);
            }
        }
		public void FixtureSetUp ()
		{
			context = new HttpContext (null);
			paea = new PassportAuthenticationEventArgs (null, context);
		}