summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/CheckAuthResponse.cs
blob: 297fb8207c938fb06d374c3026149610331da307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace DotNetOpenId.RelyingParty {
	[DebuggerDisplay("IsAuthenticationValid: {IsAuthenticationValid}, OpenId: {Protocol.Version}")]
	class CheckAuthResponse : DirectResponse {
		public CheckAuthResponse(OpenIdRelyingParty relyingParty, ServiceEndpoint provider, IDictionary<string, string> args)
			: base(relyingParty, provider, args) {
		}

		public string InvalidatedAssociationHandle {
			get {
				if (IsAuthenticationValid) {
					return Util.GetOptionalArg(Args, Protocol.openidnp.invalidate_handle);
				}
				return null;
			}
		}

		public bool IsAuthenticationValid {
			get {
				return Protocol.Args.IsValid.True.Equals(
					Util.GetRequiredArg(Args, Protocol.openidnp.is_valid), StringComparison.Ordinal);
			}
		}
	}
}