summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OpenId.RelyingParty/OpenId')
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySecurityOptions.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs138
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs6
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs37
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/UIUtilities.cs5
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs68
8 files changed, 148 insertions, 111 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySecurityOptions.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySecurityOptions.cs
index 01aa16e..90910b7 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySecurityOptions.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySecurityOptions.cs
@@ -57,6 +57,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
/// Prepares a message for sending based on the rules of this channel binding element.
/// </summary>
/// <param name="message">The message to prepare for sending.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
@@ -74,6 +75,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
/// validates an incoming message based on the rules of this channel binding element.
/// </summary>
/// <param name="message">The incoming message to process.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
index 6a6dee2..625a7e4 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
@@ -77,6 +77,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
/// <param name="message">The message.</param>
/// <param name="signedMessage">The signed message.</param>
/// <param name="protectionsApplied">The protections applied.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The applied protections.
/// </returns>
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
index d71a086..1948215 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
@@ -135,6 +135,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
/// Prepares a message for sending based on the rules of this channel binding element.
/// </summary>
/// <param name="message">The message to prepare for sending.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
@@ -161,6 +162,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
/// validates an incoming message based on the rules of this channel binding element.
/// </summary>
/// <param name="message">The incoming message to process.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The protections (if any) that this binding element applied to the message.
/// Null if this binding element did not even apply to this binding element.
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
index 910272e..fb4006c 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
@@ -71,6 +71,12 @@ namespace DotNetOpenAuth.OpenId {
this.TrustedHostMetaProxies = new List<HostMetaProxy>();
}
+ /// <summary>
+ /// Gets or sets the host factories used by this instance.
+ /// </summary>
+ /// <value>
+ /// The host factories.
+ /// </value>
public IHostFactories HostFactories { get; set; }
/// <summary>
@@ -108,8 +114,7 @@ namespace DotNetOpenAuth.OpenId {
/// Performs discovery on the specified identifier.
/// </summary>
/// <param name="identifier">The identifier to perform discovery on.</param>
- /// <param name="requestHandler">The means to place outgoing HTTP requests.</param>
- /// <param name="abortDiscoveryChain">if set to <c>true</c>, no further discovery services will be called for this identifier.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// A sequence of service endpoints yielded by discovery. Must not be null, but may be empty.
/// </returns>
@@ -182,43 +187,6 @@ namespace DotNetOpenAuth.OpenId {
}
/// <summary>
- /// Gets the services for an identifier that are described by an external XRDS document.
- /// </summary>
- /// <param name="xrds">The XRD elements to search for described-by services.</param>
- /// <param name="identifier">The identifier under discovery.</param>
- /// <param name="requestHandler">The request handler.</param>
- /// <returns>The discovered services.</returns>
- private async Task<IEnumerable<IdentifierDiscoveryResult>> GetExternalServicesAsync(IEnumerable<XrdElement> xrds, UriIdentifier identifier, CancellationToken cancellationToken) {
- Requires.NotNull(xrds, "xrds");
- Requires.NotNull(identifier, "identifier");
-
- var results = new List<IdentifierDiscoveryResult>();
- foreach (var serviceElement in GetDescribedByServices(xrds)) {
- var templateNode = serviceElement.Node.SelectSingleNode("google:URITemplate", serviceElement.XmlNamespaceResolver);
- var nextAuthorityNode = serviceElement.Node.SelectSingleNode("google:NextAuthority", serviceElement.XmlNamespaceResolver);
- if (templateNode != null) {
- Uri externalLocation = new Uri(templateNode.Value.Trim().Replace("{%uri}", Uri.EscapeDataString(identifier.Uri.AbsoluteUri)));
- string nextAuthority = nextAuthorityNode != null ? nextAuthorityNode.Value.Trim() : identifier.Uri.Host;
- try {
- using (var externalXrdsResponse = await this.GetXrdsResponseAsync(identifier, externalLocation, cancellationToken)) {
- var readerSettings = MessagingUtilities.CreateUntrustedXmlReaderSettings();
- var responseStream = await externalXrdsResponse.Content.ReadAsStreamAsync();
- XrdsDocument externalXrds = new XrdsDocument(XmlReader.Create(responseStream, readerSettings));
- await ValidateXmlDSigAsync(externalXrds, identifier, externalXrdsResponse, nextAuthority);
- results.AddRange(GetXrdElements(externalXrds, identifier).CreateServiceEndpoints(identifier, identifier));
- }
- } catch (ProtocolException ex) {
- Logger.Yadis.WarnFormat("HTTP GET error while retrieving described-by XRDS document {0}: {1}", externalLocation.AbsoluteUri, ex);
- } catch (XmlException ex) {
- Logger.Yadis.ErrorFormat("Error while parsing described-by XRDS document {0}: {1}", externalLocation.AbsoluteUri, ex);
- }
- }
- }
-
- return results;
- }
-
- /// <summary>
/// Validates the XML digital signature on an XRDS document.
/// </summary>
/// <param name="document">The XRDS document whose signature should be validated.</param>
@@ -291,11 +259,50 @@ namespace DotNetOpenAuth.OpenId {
}
/// <summary>
+ /// Gets the services for an identifier that are described by an external XRDS document.
+ /// </summary>
+ /// <param name="xrds">The XRD elements to search for described-by services.</param>
+ /// <param name="identifier">The identifier under discovery.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// The discovered services.
+ /// </returns>
+ private async Task<IEnumerable<IdentifierDiscoveryResult>> GetExternalServicesAsync(IEnumerable<XrdElement> xrds, UriIdentifier identifier, CancellationToken cancellationToken) {
+ Requires.NotNull(xrds, "xrds");
+ Requires.NotNull(identifier, "identifier");
+
+ var results = new List<IdentifierDiscoveryResult>();
+ foreach (var serviceElement in GetDescribedByServices(xrds)) {
+ var templateNode = serviceElement.Node.SelectSingleNode("google:URITemplate", serviceElement.XmlNamespaceResolver);
+ var nextAuthorityNode = serviceElement.Node.SelectSingleNode("google:NextAuthority", serviceElement.XmlNamespaceResolver);
+ if (templateNode != null) {
+ Uri externalLocation = new Uri(templateNode.Value.Trim().Replace("{%uri}", Uri.EscapeDataString(identifier.Uri.AbsoluteUri)));
+ string nextAuthority = nextAuthorityNode != null ? nextAuthorityNode.Value.Trim() : identifier.Uri.Host;
+ try {
+ using (var externalXrdsResponse = await this.GetXrdsResponseAsync(identifier, externalLocation, cancellationToken)) {
+ var readerSettings = MessagingUtilities.CreateUntrustedXmlReaderSettings();
+ var responseStream = await externalXrdsResponse.Content.ReadAsStreamAsync();
+ XrdsDocument externalXrds = new XrdsDocument(XmlReader.Create(responseStream, readerSettings));
+ await ValidateXmlDSigAsync(externalXrds, identifier, externalXrdsResponse, nextAuthority);
+ results.AddRange(GetXrdElements(externalXrds, identifier).CreateServiceEndpoints(identifier, identifier));
+ }
+ } catch (ProtocolException ex) {
+ Logger.Yadis.WarnFormat("HTTP GET error while retrieving described-by XRDS document {0}: {1}", externalLocation.AbsoluteUri, ex);
+ } catch (XmlException ex) {
+ Logger.Yadis.ErrorFormat("Error while parsing described-by XRDS document {0}: {1}", externalLocation.AbsoluteUri, ex);
+ }
+ }
+ }
+
+ return results;
+ }
+
+ /// <summary>
/// Gets the XRDS HTTP response for a given identifier.
/// </summary>
/// <param name="identifier">The identifier.</param>
- /// <param name="requestHandler">The request handler.</param>
/// <param name="xrdsLocation">The location of the XRDS document to retrieve.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// A HTTP response carrying an XRDS document.
/// </returns>
@@ -369,9 +376,10 @@ namespace DotNetOpenAuth.OpenId {
/// Gets the XRDS HTTP response for a given identifier.
/// </summary>
/// <param name="identifier">The identifier.</param>
- /// <param name="requestHandler">The request handler.</param>
- /// <param name="signingHost">The host name on the certificate that should be used to verify the signature in the XRDS.</param>
- /// <returns>A HTTP response carrying an XRDS document, or <c>null</c> if one could not be obtained.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// A HTTP response carrying an XRDS document, or <c>null</c> if one could not be obtained.
+ /// </returns>
/// <exception cref="ProtocolException">Thrown if the XRDS document could not be obtained.</exception>
private async Task<ResultWithSigningHost<HttpResponseMessage>> GetXrdsResponseAsync(UriIdentifier identifier, CancellationToken cancellationToken) {
Requires.NotNull(identifier, "identifier");
@@ -389,9 +397,10 @@ namespace DotNetOpenAuth.OpenId {
/// Gets the location of the XRDS document that describes a given identifier.
/// </summary>
/// <param name="identifier">The identifier under discovery.</param>
- /// <param name="requestHandler">The request handler.</param>
- /// <param name="signingHost">The host name on the certificate that should be used to verify the signature in the XRDS.</param>
- /// <returns>An absolute URI, or <c>null</c> if one could not be determined.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// An absolute URI, or <c>null</c> if one could not be determined.
+ /// </returns>
private async Task<ResultWithSigningHost<Uri>> GetXrdsLocationAsync(UriIdentifier identifier, CancellationToken cancellationToken) {
Requires.NotNull(identifier, "identifier");
@@ -419,8 +428,7 @@ namespace DotNetOpenAuth.OpenId {
/// Gets the host-meta for a given identifier.
/// </summary>
/// <param name="identifier">The identifier.</param>
- /// <param name="requestHandler">The request handler.</param>
- /// <param name="signingHost">The host name on the certificate that should be used to verify the signature in the XRDS.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The host-meta response, or <c>null</c> if no host-meta document could be obtained.
/// </returns>
@@ -471,6 +479,23 @@ namespace DotNetOpenAuth.OpenId {
return result;
}
+ private struct ResultWithSigningHost<T> : IDisposable {
+ internal ResultWithSigningHost(T result, string signingHost)
+ : this() {
+ this.Result = result;
+ this.SigningHost = signingHost;
+ }
+
+ public T Result { get; private set; }
+
+ public string SigningHost { get; private set; }
+
+ public void Dispose() {
+ var disposable = this.Result as IDisposable;
+ disposable.DisposeIfNotNull();
+ }
+ }
+
/// <summary>
/// A description of a web server that hosts host-meta documents.
/// </summary>
@@ -554,22 +579,5 @@ namespace DotNetOpenAuth.OpenId {
return this.ProxyFormat.GetHashCode();
}
}
-
- private struct ResultWithSigningHost<T> : IDisposable {
- internal ResultWithSigningHost(T result, string signingHost)
- : this() {
- this.Result = result;
- this.SigningHost = signingHost;
- }
-
- public T Result { get; private set; }
-
- public string SigningHost { get; private set; }
-
- public void Dispose() {
- var disposable = this.Result as IDisposable;
- disposable.DisposeIfNotNull();
- }
- }
}
}
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
index 14566e1..367c146 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
@@ -132,6 +132,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// a new association of one does not already exist.
/// </summary>
/// <param name="provider">The provider to get an association for.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The existing or new association; <c>null</c> if none existed and one could not be created.</returns>
internal async Task<Association> GetOrCreateAssociationAsync(IProviderEndpoint provider, CancellationToken cancellationToken) {
return this.GetExistingAssociation(provider) ?? await this.CreateNewAssociationAsync(provider, cancellationToken);
@@ -141,6 +142,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// Creates a new association with a given Provider.
/// </summary>
/// <param name="provider">The provider to create an association with.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The newly created association, or null if no association can be created with
/// the given Provider given the current security settings.
@@ -148,7 +150,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <remarks>
/// A new association is created and returned even if one already exists in the
/// association store.
- /// Any new association is automatically added to the <see cref="associationStore"/>.
+ /// Any new association is automatically added to the <see cref="associationStore" />.
/// </remarks>
private async Task<Association> CreateNewAssociationAsync(IProviderEndpoint provider, CancellationToken cancellationToken) {
Requires.NotNull(provider, "provider");
@@ -180,10 +182,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <param name="provider">The provider to create an association with.</param>
/// <param name="associateRequest">The associate request. May be <c>null</c>, which will always result in a <c>null</c> return value..</param>
/// <param name="retriesRemaining">The number of times to try the associate request again if the Provider suggests it.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The newly created association, or null if no association can be created with
/// the given Provider given the current security settings.
/// </returns>
+ /// <exception cref="ProtocolException"></exception>
private async Task<Association> CreateNewAssociationAsync(IProviderEndpoint provider, AssociateRequest associateRequest, int retriesRemaining, CancellationToken cancellationToken) {
Requires.NotNull(provider, "provider");
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
index 0fb5b4a..a26b49e 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
@@ -93,20 +93,6 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
public AuthenticationRequestMode Mode { get; set; }
/// <summary>
- /// Gets the HTTP response the relying party should send to the user agent
- /// to redirect it to the OpenID Provider to start the OpenID authentication process.
- /// </summary>
- /// <value></value>
- public async Task<HttpResponseMessage> GetRedirectingResponseAsync(CancellationToken cancellationToken) {
- foreach (var behavior in this.RelyingParty.Behaviors) {
- behavior.OnOutgoingAuthenticationRequest(this);
- }
-
- var request = await this.CreateRequestMessageAsync(cancellationToken);
- return await this.RelyingParty.Channel.PrepareResponseAsync(request, cancellationToken);
- }
-
- /// <summary>
/// Gets the URL that the user agent will return to after authentication
/// completes or fails at the Provider.
/// </summary>
@@ -199,6 +185,20 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
#region IAuthenticationRequest methods
/// <summary>
+ /// Gets the HTTP response the relying party should send to the user agent
+ /// to redirect it to the OpenID Provider to start the OpenID authentication process.
+ /// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ public async Task<HttpResponseMessage> GetRedirectingResponseAsync(CancellationToken cancellationToken) {
+ foreach (var behavior in this.RelyingParty.Behaviors) {
+ behavior.OnOutgoingAuthenticationRequest(this);
+ }
+
+ var request = await this.CreateRequestMessageAsync(cancellationToken);
+ return await this.RelyingParty.Channel.PrepareResponseAsync(request, cancellationToken);
+ }
+
+ /// <summary>
/// Makes a dictionary of key/value pairs available when the authentication is completed.
/// </summary>
/// <param name="arguments">The arguments to add to the request's return_to URI.</param>
@@ -305,6 +305,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <param name="realm">The realm.</param>
/// <param name="returnToUrl">The return_to base URL.</param>
/// <param name="createNewAssociationsAsNeeded">if set to <c>true</c>, associations that do not exist between this Relying Party and the asserting Providers are created before the authentication request is created.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// A sequence of authentication requests, any of which constitutes a valid identity assertion on the Claimed Identifier.
/// Never null, but may be empty.
@@ -391,13 +392,16 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// Creates the request message to send to the Provider,
/// based on the properties in this instance.
/// </summary>
- /// <returns>The message to send to the Provider.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// The message to send to the Provider.
+ /// </returns>
internal Task<SignedResponseRequest> CreateRequestMessageTestHookAsync(CancellationToken cancellationToken) {
return this.CreateRequestMessageAsync(cancellationToken);
}
/// <summary>
- /// Performs deferred request generation for the <see cref="Create"/> method.
+ /// Performs deferred request generation for the <see cref="Create" /> method.
/// </summary>
/// <param name="userSuppliedIdentifier">The user supplied identifier.</param>
/// <param name="relyingParty">The relying party.</param>
@@ -405,6 +409,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <param name="returnToUrl">The return_to base URL.</param>
/// <param name="serviceEndpoints">The discovered service endpoints on the Claimed Identifier.</param>
/// <param name="createNewAssociationsAsNeeded">if set to <c>true</c>, associations that do not exist between this Relying Party and the asserting Providers are created before the authentication request is created.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// A sequence of authentication requests, any of which constitutes a valid identity assertion on the Claimed Identifier.
/// Never null, but may be empty.
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/UIUtilities.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/UIUtilities.cs
index 80bfe65..4e138ee 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/UIUtilities.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/UIUtilities.cs
@@ -24,7 +24,10 @@ using Validation;
/// <param name="relyingParty">The relying party.</param>
/// <param name="request">The authentication request to place in the window.</param>
/// <param name="windowName">The name to assign to the popup window.</param>
- /// <returns>A string starting with 'window.open' and forming just that one method call.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// A string starting with 'window.open' and forming just that one method call.
+ /// </returns>
internal static async Task<string> GetWindowPopupScriptAsync(OpenIdRelyingParty relyingParty, IAuthenticationRequest request, string windowName, CancellationToken cancellationToken) {
Requires.NotNull(relyingParty, "relyingParty");
Requires.NotNull(request, "request");
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
index a129334..b190ce3 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
@@ -157,31 +157,6 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
/// <summary>
- /// Gets the standard state storage mechanism that uses ASP.NET's
- /// HttpApplication state dictionary to store associations and nonces.
- /// </summary>
- public static IOpenIdApplicationStore GetHttpApplicationStore(HttpContextBase context = null) {
- if (context == null) {
- ErrorUtilities.VerifyOperation(HttpContext.Current != null, Strings.StoreRequiredWhenNoHttpContextAvailable, typeof(IOpenIdApplicationStore).Name);
- context = new HttpContextWrapper(HttpContext.Current);
- }
-
- var store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey];
- if (store == null) {
- context.Application.Lock();
- try {
- if ((store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]) == null) {
- context.Application[ApplicationStoreKey] = store = new StandardRelyingPartyApplicationStore();
- }
- } finally {
- context.Application.UnLock();
- }
- }
-
- return store;
- }
-
- /// <summary>
/// Gets or sets the channel to use for sending/receiving messages.
/// </summary>
public Channel Channel {
@@ -314,6 +289,33 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
/// <summary>
+ /// Gets the standard state storage mechanism that uses ASP.NET's
+ /// HttpApplication state dictionary to store associations and nonces.
+ /// </summary>
+ /// <param name="context">The context.</param>
+ /// <returns>The application store.</returns>
+ public static IOpenIdApplicationStore GetHttpApplicationStore(HttpContextBase context = null) {
+ if (context == null) {
+ ErrorUtilities.VerifyOperation(HttpContext.Current != null, Strings.StoreRequiredWhenNoHttpContextAvailable, typeof(IOpenIdApplicationStore).Name);
+ context = new HttpContextWrapper(HttpContext.Current);
+ }
+
+ var store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey];
+ if (store == null) {
+ context.Application.Lock();
+ try {
+ if ((store = (IOpenIdApplicationStore)context.Application[ApplicationStoreKey]) == null) {
+ context.Application[ApplicationStoreKey] = store = new StandardRelyingPartyApplicationStore();
+ }
+ } finally {
+ context.Application.UnLock();
+ }
+ }
+
+ return store;
+ }
+
+ /// <summary>
/// Creates an authentication request to verify that a user controls
/// some given Identifier.
/// </summary>
@@ -520,7 +522,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// Gets an authentication response from a Provider.
/// </summary>
/// <param name="httpRequestInfo">The HTTP request that may be carrying an authentication response from the Provider.</param>
- /// <returns>The processed authentication response if there is any; <c>null</c> otherwise.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// The processed authentication response if there is any; <c>null</c> otherwise.
+ /// </returns>
public async Task<IAuthenticationResponse> GetResponseAsync(HttpRequestBase httpRequestInfo, CancellationToken cancellationToken) {
Requires.NotNull(httpRequestInfo, "httpRequestInfo");
try {
@@ -574,7 +579,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// Processes the response received in a popup window or iframe to an AJAX-directed OpenID authentication.
/// </summary>
/// <param name="request">The incoming HTTP request that is expected to carry an OpenID authentication response.</param>
- /// <returns>The HTTP response to send to this HTTP request.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// The HTTP response to send to this HTTP request.
+ /// </returns>
public Task<HttpResponseMessage> ProcessResponseFromPopupAsync(HttpRequestBase request, CancellationToken cancellationToken) {
Requires.NotNull(request, "request");
@@ -657,6 +665,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// </summary>
/// <param name="request">The incoming HTTP request that is expected to carry an OpenID authentication response.</param>
/// <param name="callback">The callback fired after the response status has been determined but before the Javascript response is formulated.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// The HTTP response to send to this HTTP request.
/// </returns>
@@ -716,7 +725,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// Performs discovery on the specified identifier.
/// </summary>
/// <param name="identifier">The identifier to discover services for.</param>
- /// <returns>A non-null sequence of services discovered for the identifier.</returns>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>
+ /// A non-null sequence of services discovered for the identifier.
+ /// </returns>
internal Task<IEnumerable<IdentifierDiscoveryResult>> DiscoverAsync(Identifier identifier, CancellationToken cancellationToken) {
return this.discoveryServices.DiscoverAsync(identifier, cancellationToken);
}