summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-12-15 22:17:20 -0800
commite12782c1a6727390b2107ff2e39d4ac6173d86fc (patch)
tree3be0ccda0a9425927263f5b6b9616ef8ba11ac08 /src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs
parent078b1f350eb40ceee7423c25b1d833dd1f242da4 (diff)
parenta545f7be2693596fa14540c359e43150a6a7cf88 (diff)
downloadDotNetOpenAuth-origin/mono.zip
DotNetOpenAuth-origin/mono.tar.gz
DotNetOpenAuth-origin/mono.tar.bz2
Merge branch 'v2.5' into monoorigin/mono
Conflicts: src/DotNetOpenId/Properties/AssemblyInfo.cs src/DotNetOpenId/RelyingParty/AuthenticationResponse.cs
Diffstat (limited to 'src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs')
-rw-r--r--src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs b/src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs
new file mode 100644
index 0000000..7026aaa
--- /dev/null
+++ b/src/DotNetOpenId/RelyingParty/AuthenticationResponseSnapshot.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace DotNetOpenId.RelyingParty {
+ [Serializable]
+ class AuthenticationResponseSnapshot : IAuthenticationResponse {
+ internal AuthenticationResponseSnapshot(IAuthenticationResponse copyFrom) {
+ if (copyFrom == null) throw new ArgumentNullException("copyFrom");
+
+ ClaimedIdentifier = copyFrom.ClaimedIdentifier;
+ FriendlyIdentifierForDisplay = copyFrom.FriendlyIdentifierForDisplay;
+ Status = copyFrom.Status;
+ callbackArguments = copyFrom.GetCallbackArguments();
+ }
+
+ IDictionary<string, string> callbackArguments;
+
+ #region IAuthenticationResponse Members
+
+ public IDictionary<string, string> GetCallbackArguments() {
+ // Return a copy so that the caller cannot change the contents.
+ return new Dictionary<string, string>(callbackArguments);
+ }
+
+ public string GetCallbackArgument(string key) {
+ if (String.IsNullOrEmpty(key)) throw new ArgumentNullException("key");
+
+ string value;
+ if (callbackArguments.TryGetValue(key, out value)) {
+ return value;
+ }
+ return null;
+ }
+
+ public T GetExtension<T>() where T : DotNetOpenId.Extensions.IExtensionResponse, new() {
+ throw new NotSupportedException(Strings.NotSupportedByAuthenticationSnapshot);
+ }
+
+ public DotNetOpenId.Extensions.IExtensionResponse GetExtension(Type extensionType) {
+ throw new NotSupportedException(Strings.NotSupportedByAuthenticationSnapshot);
+ }
+
+ public Identifier ClaimedIdentifier { get; private set; }
+
+ public string FriendlyIdentifierForDisplay { get; private set; }
+
+ public AuthenticationStatus Status { get; private set; }
+
+ public Exception Exception {
+ get { throw new NotSupportedException(Strings.NotSupportedByAuthenticationSnapshot); }
+ }
+
+ #endregion
+ }
+}