Esempio n. 1
0
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a WindowsIdentity
        /// <include file='doc\WindowsAuthenticationModule.uex' path='docs/doc[@for="WindowsAuthenticationModule.OnAuthenticate"]/*' />
        /// <devdoc>
        ///    Calls the
        ///    WindowsAuthentication_OnAuthenticate handler if one exists.
        /// </devdoc>
        void OnAuthenticate(WindowsAuthenticationEventArgs e)
        {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null)
            {
                _eventHandler(this, e);
            }

            if (e.Context.User == null)
            {
                if (e.User != null)
                {
                    e.Context.User = e.User;
                }
                else if (e.Identity == _anonymousIdentity)
                {
                    e.Context.User = _anonymousPrincipal;
                }
                else
                {
                    e.Context.User = new WindowsPrincipal(e.Identity);
                }
            }
        }
Esempio n. 2
0
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a WindowsIdentity

        /// <devdoc>
        ///    Calls the
        ///    WindowsAuthentication_OnAuthenticate handler if one exists.
        /// </devdoc>
        void OnAuthenticate(WindowsAuthenticationEventArgs e)
        {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null)
            {
                _eventHandler(this, e);
            }

            if (e.Context.User == null)
            {
                if (e.User != null)
                {
                    e.Context.User = e.User;
                }
                else if (e.Identity == AnonymousIdentity)
                {
                    e.Context.SetPrincipalNoDemand(AnonymousPrincipal, false /*needToSetNativePrincipal*/);
                }
                else
                {
                    e.Context.SetPrincipalNoDemand(new WindowsPrincipal(e.Identity), false /*needToSetNativePrincipal*/);
                }
            }
        }
 private void OnAuthenticate(WindowsAuthenticationEventArgs e)
 {
     if (this._eventHandler != null)
     {
         this._eventHandler(this, e);
     }
     if (e.Context.User == null)
     {
         if (e.User != null)
         {
             e.Context.User = e.User;
         }
         else if (e.Identity == _anonymousIdentity)
         {
             e.Context.SetPrincipalNoDemand(_anonymousPrincipal, false);
         }
         else
         {
             e.Context.SetPrincipalNoDemand(new WindowsPrincipal(e.Identity), false);
         }
     }
 }
 private void OnAuthenticate(WindowsAuthenticationEventArgs e)
 {
     if (this._eventHandler != null)
     {
         this._eventHandler(this, e);
     }
     if (e.Context.User == null)
     {
         if (e.User != null)
         {
             e.Context.User = e.User;
         }
         else if (e.Identity == _anonymousIdentity)
         {
             e.Context.SetPrincipalNoDemand(_anonymousPrincipal, false);
         }
         else
         {
             e.Context.SetPrincipalNoDemand(new WindowsPrincipal(e.Identity), false);
         }
     }
 }
 public void WindowsAuthentication_OnAuthenticate(Object Source, WindowsAuthenticationEventArgs e)
 {
     e.User = new RolablePrincipal(e.Identity);
 }
        ////////////////////////////////////////////////////////////
        // OnAuthenticate: Custom Authentication modules can override
        //             this method to create a custom IPrincipal object from
        //             a WindowsIdentity

        /// <devdoc>
        ///    Calls the
        ///    WindowsAuthentication_OnAuthenticate handler if one exists.
        /// </devdoc>
        void OnAuthenticate(WindowsAuthenticationEventArgs e) {
            ////////////////////////////////////////////////////////////
            // If there are event handlers, invoke the handlers
            if (_eventHandler != null)
                 _eventHandler(this, e);

            if (e.Context.User == null)
            {
                if (e.User != null)
                    e.Context.User = e.User;
                else  if (e.Identity == AnonymousIdentity)
                    e.Context.SetPrincipalNoDemand(AnonymousPrincipal, false /*needToSetNativePrincipal*/);
                else
                    e.Context.SetPrincipalNoDemand(new WindowsPrincipal(e.Identity), false /*needToSetNativePrincipal*/);
            }
        }
		private void Authenticate (object sender, WindowsAuthenticationEventArgs e)
		{
		}
Esempio n. 8
0
 protected void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs e)
 {
 }
		public void FixtureSetUp ()
		{
			context = new HttpContext (null);
			waea = new WindowsAuthenticationEventArgs (null, context);
		}