summaryrefslogtreecommitdiffstats
path: root/samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-06-25 19:51:02 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-06-25 19:51:02 -0700
commit3b2fe4819cf449d1ab88178d055239c64b3cfd5e (patch)
treee191391cc71af22a854a06fee0079dbb74405752 /samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs
parent97e3fc44a6911289baf3435febc0b003e56ad4e8 (diff)
parentf3ce247dfaa965011c7f8417d00e0fa3dfad4a35 (diff)
downloadDotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.zip
DotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.tar.gz
DotNetOpenAuth-3b2fe4819cf449d1ab88178d055239c64b3cfd5e.tar.bz2
Merge branch 'master' into contracts
Conflicts: src/DotNetOpenAuth.vsmdi src/DotNetOpenAuth/Configuration/TypeConfigurationCollection.cs src/DotNetOpenAuth/Configuration/TypeConfigurationElement.cs src/DotNetOpenAuth/DotNetOpenAuth.csproj src/DotNetOpenAuth/Messaging/HttpRequestInfo.cs src/DotNetOpenAuth/Messaging/Reflection/MessagePart.cs src/DotNetOpenAuth/Messaging/Reflection/ValueMapping.cs src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs src/DotNetOpenAuth/OAuth/ConsumerBase.cs src/DotNetOpenAuth/OAuth/Messages/MessageBase.cs src/DotNetOpenAuth/OAuth/Messages/UnauthorizedTokenResponse.cs src/DotNetOpenAuth/OAuth/ServiceProvider.cs src/DotNetOpenAuth/OpenId/Protocol.cs src/DotNetOpenAuth/OpenId/Provider/AutoResponsiveRequest.cs src/DotNetOpenAuth/OpenId/Provider/HostProcessedRequest.cs src/DotNetOpenAuth/OpenId/Provider/IHostProcessedRequest.cs src/DotNetOpenAuth/OpenId/Provider/Request.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs src/DotNetOpenAuth/OpenId/RelyingParty/ServiceEndpoint.cs
Diffstat (limited to 'samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs')
-rw-r--r--samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs38
1 files changed, 0 insertions, 38 deletions
diff --git a/samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs b/samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs
deleted file mode 100644
index a737d30..0000000
--- a/samples/DotNetOpenAuth.ApplicationBlock/Provider/AuthenticationRequestExtensions.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace DotNetOpenAuth.ApplicationBlock.Provider {
- using System;
- using DotNetOpenAuth.OpenId;
- using DotNetOpenAuth.OpenId.Provider;
-
- public static class AuthenticationRequestExtensions {
- /// <summary>
- /// Removes all personally identifiable information from the positive assertion.
- /// </summary>
- /// <param name="request">The incoming authentication request.</param>
- /// <param name="localIdentifier">The OP local identifier, before the anonymous hash is applied to it.</param>
- /// <param name="anonymousIdentifierProvider">The anonymous identifier provider.</param>
- /// <param name="pairwiseUnique">if set to <c>true</c> the anonymous identifier will be unique to the requesting relying party's realm.</param>
- /// <remarks>
- /// The openid.claimed_id and openid.identity values are hashed.
- /// </remarks>
- public static void ScrubPersonallyIdentifiableInformation(this IAuthenticationRequest request, Identifier localIdentifier, AnonymousIdentifierProviderBase anonymousIdentifierProvider, bool pairwiseUnique) {
- if (request == null) {
- throw new ArgumentNullException("request");
- }
- if (!request.IsDirectedIdentity) {
- throw new InvalidOperationException("This operation is supported only under identifier select (directed identity) scenarios.");
- }
- if (anonymousIdentifierProvider == null) {
- throw new ArgumentNullException("anonymousIdentifierProvider");
- }
- if (localIdentifier == null) {
- throw new ArgumentNullException("localIdentifier");
- }
-
- // When generating the anonymous identifiers, the openid.identity and openid.claimed_id
- // will always end up with matching values.
- var anonymousIdentifier = anonymousIdentifierProvider.GetAnonymousIdentifier(localIdentifier, pairwiseUnique ? request.Realm : null);
- request.ClaimedIdentifier = anonymousIdentifier;
- request.LocalIdentifier = anonymousIdentifier;
- }
- }
-}