summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty')
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs8
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/IProviderEndpoint.cs144
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs4
3 files changed, 6 insertions, 150 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
index 9a43506..b0c543c 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
@@ -157,7 +157,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
try {
- var associateRequest = AssociateRequest.Create(this.securitySettings, provider);
+ var associateRequest = AssociateRequestRelyingParty.Create(this.securitySettings, provider);
const int RenegotiateRetries = 1;
return this.CreateNewAssociation(provider, associateRequest, RenegotiateRetries);
@@ -193,10 +193,10 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
try {
var associateResponse = this.channel.Request(associateRequest);
- var associateSuccessfulResponse = associateResponse as AssociateSuccessfulResponse;
+ var associateSuccessfulResponse = associateResponse as AssociateSuccessfulResponseRelyingParty;
var associateUnsuccessfulResponse = associateResponse as AssociateUnsuccessfulResponse;
if (associateSuccessfulResponse != null) {
- Association association = associateSuccessfulResponse.CreateAssociation(associateRequest, null, null);
+ Association association = associateSuccessfulResponse.CreateAssociationAtRelyingParty(associateRequest);
this.associationStore.StoreAssociation(provider.Uri, association);
return association;
} else if (associateUnsuccessfulResponse != null) {
@@ -223,7 +223,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
associateUnsuccessfulResponse.AssociationType,
associateUnsuccessfulResponse.SessionType);
- associateRequest = AssociateRequest.Create(this.securitySettings, provider, associateUnsuccessfulResponse.AssociationType, associateUnsuccessfulResponse.SessionType);
+ associateRequest = AssociateRequestRelyingParty.Create(this.securitySettings, provider, associateUnsuccessfulResponse.AssociationType, associateUnsuccessfulResponse.SessionType);
return this.CreateNewAssociation(provider, associateRequest, retriesRemaining - 1);
} else {
throw new ProtocolException(MessagingStrings.UnexpectedMessageReceivedOfMany);
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/IProviderEndpoint.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/IProviderEndpoint.cs
deleted file mode 100644
index 5d8918d..0000000
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/IProviderEndpoint.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="IProviderEndpoint.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOpenAuth.OpenId.RelyingParty {
- using System;
- using System.Collections.ObjectModel;
- using System.Diagnostics.CodeAnalysis;
- using System.Diagnostics.Contracts;
- using System.Globalization;
- using DotNetOpenAuth.Messaging;
- using DotNetOpenAuth.OpenId.Messages;
-
- /// <summary>
- /// Information published about an OpenId Provider by the
- /// OpenId discovery documents found at a user's Claimed Identifier.
- /// </summary>
- /// <remarks>
- /// Because information provided by this interface is suppplied by a
- /// user's individually published documents, it may be incomplete or inaccurate.
- /// </remarks>
- [ContractClass(typeof(IProviderEndpointContract))]
- public interface IProviderEndpoint {
- /// <summary>
- /// Gets the detected version of OpenID implemented by the Provider.
- /// </summary>
- Version Version { get; }
-
- /// <summary>
- /// Gets the URL that the OpenID Provider receives authentication requests at.
- /// </summary>
- /// <value>
- /// This value MUST be an absolute HTTP or HTTPS URL.
- /// </value>
- Uri Uri { get; }
-
- /// <summary>
- /// Checks whether the OpenId Identifier claims support for a given extension.
- /// </summary>
- /// <typeparam name="T">The extension whose support is being queried.</typeparam>
- /// <returns>True if support for the extension is advertised. False otherwise.</returns>
- /// <remarks>
- /// Note that a true or false return value is no guarantee of a Provider's
- /// support for or lack of support for an extension. The return value is
- /// determined by how the authenticating user filled out his/her XRDS document only.
- /// The only way to be sure of support for a given extension is to include
- /// the extension in the request and see if a response comes back for that extension.
- /// </remarks>
- [SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "No parameter at all.")]
- [Obsolete("Use IAuthenticationRequest.DiscoveryResult.IsExtensionSupported instead.")]
- bool IsExtensionSupported<T>() where T : IOpenIdMessageExtension, new();
-
- /// <summary>
- /// Checks whether the OpenId Identifier claims support for a given extension.
- /// </summary>
- /// <param name="extensionType">The extension whose support is being queried.</param>
- /// <returns>True if support for the extension is advertised. False otherwise.</returns>
- /// <remarks>
- /// Note that a true or false return value is no guarantee of a Provider's
- /// support for or lack of support for an extension. The return value is
- /// determined by how the authenticating user filled out his/her XRDS document only.
- /// The only way to be sure of support for a given extension is to include
- /// the extension in the request and see if a response comes back for that extension.
- /// </remarks>
- [Obsolete("Use IAuthenticationRequest.DiscoveryResult.IsExtensionSupported instead.")]
- bool IsExtensionSupported(Type extensionType);
- }
-
- /// <summary>
- /// Code contract for the <see cref="IProviderEndpoint"/> type.
- /// </summary>
- [ContractClassFor(typeof(IProviderEndpoint))]
- internal abstract class IProviderEndpointContract : IProviderEndpoint {
- /// <summary>
- /// Prevents a default instance of the <see cref="IProviderEndpointContract"/> class from being created.
- /// </summary>
- private IProviderEndpointContract() {
- }
-
- #region IProviderEndpoint Members
-
- /// <summary>
- /// Gets the detected version of OpenID implemented by the Provider.
- /// </summary>
- Version IProviderEndpoint.Version {
- get {
- Contract.Ensures(Contract.Result<Version>() != null);
- throw new System.NotImplementedException();
- }
- }
-
- /// <summary>
- /// Gets the URL that the OpenID Provider receives authentication requests at.
- /// </summary>
- Uri IProviderEndpoint.Uri {
- get {
- Contract.Ensures(Contract.Result<Uri>() != null);
- throw new System.NotImplementedException();
- }
- }
-
- /// <summary>
- /// Checks whether the OpenId Identifier claims support for a given extension.
- /// </summary>
- /// <typeparam name="T">The extension whose support is being queried.</typeparam>
- /// <returns>
- /// True if support for the extension is advertised. False otherwise.
- /// </returns>
- /// <remarks>
- /// Note that a true or false return value is no guarantee of a Provider's
- /// support for or lack of support for an extension. The return value is
- /// determined by how the authenticating user filled out his/her XRDS document only.
- /// The only way to be sure of support for a given extension is to include
- /// the extension in the request and see if a response comes back for that extension.
- /// </remarks>
- bool IProviderEndpoint.IsExtensionSupported<T>() {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Checks whether the OpenId Identifier claims support for a given extension.
- /// </summary>
- /// <param name="extensionType">The extension whose support is being queried.</param>
- /// <returns>
- /// True if support for the extension is advertised. False otherwise.
- /// </returns>
- /// <remarks>
- /// Note that a true or false return value is no guarantee of a Provider's
- /// support for or lack of support for an extension. The return value is
- /// determined by how the authenticating user filled out his/her XRDS document only.
- /// The only way to be sure of support for a given extension is to include
- /// the extension in the request and see if a response comes back for that extension.
- /// </remarks>
- bool IProviderEndpoint.IsExtensionSupported(Type extensionType) {
- Contract.Requires<ArgumentNullException>(extensionType != null);
- Contract.Requires<ArgumentException>(typeof(IOpenIdMessageExtension).IsAssignableFrom(extensionType));
- throw new NotImplementedException();
- }
-
- #endregion
- }
-}
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
index 290d29e..d39d2ca 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
@@ -141,7 +141,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
cryptoKeyStore = new MemoryCryptoKeyStore();
}
- this.channel = new OpenIdChannel(cryptoKeyStore, nonceStore, this.SecuritySettings);
+ this.channel = new OpenIdRelyingPartyChannel(cryptoKeyStore, nonceStore, this.SecuritySettings);
this.AssociationManager = new AssociationManager(this.Channel, new CryptoKeyStoreAsRelyingPartyAssociationStore(cryptoKeyStore), this.SecuritySettings);
Reporting.RecordFeatureAndDependencyUse(this, cryptoKeyStore, nonceStore);
@@ -665,7 +665,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
internal static OpenIdRelyingParty CreateNonVerifying() {
OpenIdRelyingParty rp = new OpenIdRelyingParty();
try {
- rp.Channel = OpenIdChannel.CreateNonVerifyingChannel();
+ rp.Channel = OpenIdRelyingPartyChannel.CreateNonVerifyingChannel();
return rp;
} catch {
rp.Dispose();