Пример #1
0
 protected void btnOpenIdLogin_LoggedIn(object sender, OpenIdEventArgs e)
 {
     e.Cancel = true;
     if (e.Response.Status == AuthenticationStatus.Authenticated &&
         SecurityHelper.Authenticate(e.ClaimedIdentifier, chkRememberMe.Checked))
     {
         ReturnToUrl(Config.CurrentBlog.AdminHomeVirtualUrl);
     }
 }
Пример #2
0
		protected void OpenIdAjaxTextBox1_LoggedIn(object sender, OpenIdEventArgs e) {
			Label label = ((Label)commentSubmitted.FindControl("emailLabel"));
			label.Text = e.Response.FriendlyIdentifierForDisplay;

			// We COULD get the sreg extension response here for the email, but since we let the user
			// potentially change the email in the HTML form, we'll use that instead.
			//var claims = OpenIdAjaxTextBox1.AuthenticationResponse.GetExtension<ClaimsResponse>();
			if (emailAddressBox.Text.Length > 0) {
				label.Text += " (" + emailAddressBox.Text + ")";
			}
		}
Пример #3
0
 /// <summary>
 /// Fires the <see cref="LoggedIn"/> event.
 /// </summary>
 protected virtual void OnLoggedIn(IAuthenticationResponse response)
 {
     if (response == null) throw new ArgumentNullException("response");
     Debug.Assert(response.Status == AuthenticationStatus.Authenticated);
     var loggedIn = LoggedIn;
     OpenIdEventArgs args = new OpenIdEventArgs(response);
     if (loggedIn != null)
         loggedIn(this, args);
     if (!args.Cancel)
         FormsAuthentication.RedirectFromLoginPage(
             response.ClaimedIdentifier.ToString(), UsePersistentCookie);
 }
Пример #4
0
		protected void OpenIdAjaxTextBox1_UnconfirmedPositiveAssertion(object sender, OpenIdEventArgs e) {
			// This is where we register extensions that we want to have available in javascript
			// on the browser.
			OpenIdAjaxTextBox1.RegisterClientScriptExtension<ClaimsResponse>("sreg");
		}
Пример #5
0
		protected void OpenIdAjaxTextBox1_LoggingIn(object sender, OpenIdEventArgs e) {
			e.Request.AddExtension(new ClaimsRequest {
				Email = DemandLevel.Request,
			});
		}
Пример #6
0
 protected void OpenIdLogin1_SetupRequired(object sender, OpenIdEventArgs e)
 {
     loginFailedLabel.Text = "You must log into your Provider first to use Immediate mode.";
     loginFailedLabel.Visible = true;
 }
Пример #7
0
 /// <summary>
 /// Fired upon login.
 /// Note, that straight after login, forms auth will redirect the user to their original page. So this page may never be rendererd.
 /// </summary>
 protected void OpenIdLogin1_LoggedIn(object sender, OpenIdEventArgs e)
 {
     State.FriendlyLoginName = e.Response.FriendlyIdentifierForDisplay;
     State.ProfileFields = e.Response.GetExtension<ClaimsResponse>();
 }
Пример #8
0
 protected void OpenIdLogin1_Failed(object sender, OpenIdEventArgs e)
 {
     loginFailedLabel.Visible = true;
     loginFailedLabel.Text += ": " + e.Response.Exception.Message;
 }
Пример #9
0
 protected void OpenIdLogin1_Canceled(object sender, OpenIdEventArgs e)
 {
     loginCanceledLabel.Visible = true;
 }
Пример #10
0
 protected void openid_identifier_UnconfirmedPositiveAssertion(object sender, OpenIdEventArgs e)
 {
     openid_identifier.RegisterClientScriptExtension<ClaimsResponse>("sreg");
 }
Пример #11
0
 protected void openid_identifier_LoggingIn(object sender, OpenIdEventArgs e)
 {
     ClaimsRequest fetch = new ClaimsRequest();
      fetch.Email = DemandLevel.Require;
      fetch.Nickname = DemandLevel.Require;
      fetch.FullName = DemandLevel.Request;
      e.Request.AddExtension(fetch);
 }
Пример #12
0
	protected void OpenIdLogin1_SetupRequired(object sender, OpenIdEventArgs e) {
		setupRequiredLabel.Visible = true;
	}
Пример #13
0
	protected void OpenIdLogin1_LoggingIn(object sender, OpenIdEventArgs e) {
		prepareRequest(e.Request);
	}
Пример #14
0
 /// <summary>
 /// Fires the <see cref="LoggingIn"/> event.
 /// </summary>
 /// <returns>
 /// Returns whether the login should proceed.  False if some event handler canceled the request.
 /// </returns>
 protected virtual bool OnLoggingIn()
 {
     EventHandler<OpenIdEventArgs> loggingIn = LoggingIn;
     if (Request == null)
         CreateRequest();
     if (Request != null) {
         OpenIdEventArgs args = new OpenIdEventArgs(Request);
         if (loggingIn != null)
             loggingIn(this, args);
         return !args.Cancel;
     } else
         return false;
 }