Esempio n. 1
0
        /// <summary>
        /// Initialize the authentication module events.
        /// </summary>
        /// <param name="context"></param>
        /// <remarks>
        /// This function if called once by asp.net once, when the
        /// application starts.
        /// </remarks>
        public void Init(HttpApplication context)
        {
            // Create authenticators
            var af = AuthenticatorFactory.Create(null);

            this.authenticators = af.CreateRequestAuthenticators();

            // Wire up request events
            // --- Call all authenticators in this one
            context.AuthenticateRequest += new EventHandler(OnAuthenticateRequest);
            // --- Associate identity with graywulf user
            context.PostAuthenticateRequest += new EventHandler(OnPostAuthenticateRequest);
        }
Esempio n. 2
0
        private void CreateAuthenticatorButtons()
        {
            var af = new AuthenticatorFactory();
            var aus = af.CreateInteractiveAuthenticators();

            for (int i = 0; i < aus.Length; i++)
            {

                var b = new ImageButton()
                {
                    CausesValidation = false,
                    AlternateText = aus[i].DisplayName,
                    ToolTip = String.Format("Log on using {0}.", aus[i].DisplayName),
                    CommandArgument = String.Format("{0}|{1}", aus[i].Protocol, aus[i].AuthorityUri)
                };

                b.Click += new ImageClickEventHandler(AuthenticatorButton_Click);

                Authenticators.Controls.Add(b);
            }

            // Focus on the 'sign in' button
            Ok.Focus();
        }
Esempio n. 3
0
        private InteractiveAuthenticatorBase CreateAuthenticator(string key)
        {
            var af = new AuthenticatorFactory();
            var parts = key.Split('|');
            var a = af.CreateInteractiveAuthenticator(parts[0], parts[1]);

            return a;
        }