summaryrefslogtreecommitdiffstats
path: root/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs
blob: e44fd83f1423547aec7634caf2563f8a7fe5e14f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace RelyingPartyLogic {
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Web;

	public partial class AuthenticationToken {
		public bool IsInfoCard {
			get { return this.ClaimedIdentifier.StartsWith(UriPrefixForInfoCard); }
		}

		private static string UriPrefixForInfoCard {
			get { return new Uri(Utilities.ApplicationRoot, "infocard/").AbsoluteUri; }
		}

		public static string SynthesizeClaimedIdentifierFromInfoCard(string uniqueId) {
			string synthesizedClaimedId = UriPrefixForInfoCard + Uri.EscapeDataString(uniqueId);
			return synthesizedClaimedId;
		}
	}
}