public OpenIdClient CreateOpenIdClient() { OpenIdClient returnValue = new OpenIdClient(); returnValue.EnableStatefulMode(associationManager, sessionManager); // todo: make this a property returnValue.Identity = System.Configuration.ConfigurationManager.AppSettings["openid.default.openid"]; return returnValue; }
protected OpenIdClient GetConsumer() { // Initialize a new OpenIdClient, reading arguments // from the current request, and using Session and // Application objects to store data. For more // flexibility, see "Disabling Stateful Mode" and // "Persisting Stateful Data" below for more information. OpenIdClient openid = new OpenIdClient(); openid.EnableStatefulMode(associationManager, sessionManager); // Subscribe to all the events that could occur openid.ValidationSucceeded += new EventHandler(openid_ValidationSucceeded); openid.ValidationFailed += new EventHandler(openid_ValidationFailed); openid.ReceivedCancel += new EventHandler(openid_ReceivedCancel); // Subscribing to SetupNeeded is only needed if using immediate authentication openid.ReceivedSetupNeeded += new EventHandler(openid_SetupNeeded); return openid; }
/// <summary> /// Create a new OpenIdClient object with settings appropriate for this class. /// </summary> /// <param name="arguments">The <see cref="NameValueCollection"/> containing the received arguments.</param> /// <returns>The created OpenIdClient object.</returns> OpenIdClient GetConsumer(NameValueCollection arguments) { openid = new OpenIdClient(arguments); if (_StatefulMode) { openid.EnableStatefulMode(_AssociationManager, _SessionManager); } openid.Identity = _Identity; if (_DirectedProviderUrl != null) { openid.UseDirectedIdentity = true; openid.ProviderUrl = _DirectedProviderUrl; } SetConsumerUrls(); return openid; }