Beispiel #1
0
        public void RaisePostBackEvent(string eventArgument)
        {
            OpenIDConsumer openid = new OpenIDConsumer();
            SetAuthMode(openid);
            SimpleRegistration sr = new SimpleRegistration(openid);
            if (!String.IsNullOrEmpty(this.RequiredFields)) { sr.RequiredFields = this.RequiredFields; }
            if (!String.IsNullOrEmpty(this.OptionalFields)) { sr.OptionalFields = this.OptionalFields; }
            if (!String.IsNullOrEmpty(this.PolicyURL)) { sr.PolicyURL = this.PolicyURL; }

            if (String.IsNullOrEmpty(OpenIDServerURL))
            {
                openid.Identity = Page.Request["openIdLogin"];
                this.Identity = openid.Identity;
            }
            else
            {
                openid.UseDirectedIdentity = true;
                openid.OpenIDServer = OpenIDServerURL;
            }

            //OnLogin(e);
            openid.BeginAuth();

            //if (openid.IsError())
            //{
            //    LLabel.Text = TranslateError(openid.GetError());
            //}
            //else
            //{
            //    LLabel.Text = "";
            //}
        }
    /// <summary>
    /// User has clicked the login button. Sets up a new OpenIDConsumer
    /// object and begins the authentication sequence. 
    /// Fires the OnLogin event. 
    /// </summary>
    /// <param name="sender">Object invoking this method.</param>
    /// <param name="e">EventArgs related to this request.</param>
    protected void Button_Click(object sender, EventArgs e)
    {
        OpenIDConsumer openid = new OpenIDConsumer();
        SetAuthMode(openid);
        SimpleRegistration sr = new SimpleRegistration(openid);
        if (this.RequiredFields != null) { sr.RequiredFields = this.RequiredFields; }
        if (this.OptionalFields != null) { sr.OptionalFields = this.OptionalFields; }
        if (this.PolicyURL != null) { sr.PolicyURL = this.PolicyURL; }
        openid.Identity = openid_url.Text;
        this.Identity = openid.Identity;
        OnLogin(e);
        openid.BeginAuth();

        if (openid.IsError())
        {
            LLabel.Text = openid.GetError();
        }
        else
        {
            LLabel.Text = "";
        }
    }