summaryrefslogtreecommitdiffstats
path: root/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-11-13 17:04:21 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-11-13 17:04:21 -0800
commite778892f1d9bf964c30ba6a10e50aedf12c2e857 (patch)
tree73ef8790efd0348348fb64e6cf8d438932635016 /projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs
parent888abd61a54576ff244533693df77f174f03c2bb (diff)
downloadDotNetOpenAuth-e778892f1d9bf964c30ba6a10e50aedf12c2e857.zip
DotNetOpenAuth-e778892f1d9bf964c30ba6a10e50aedf12c2e857.tar.gz
DotNetOpenAuth-e778892f1d9bf964c30ba6a10e50aedf12c2e857.tar.bz2
Moved all the project template logic that would be common between MVC and web forms web sites into its own library.
Diffstat (limited to 'projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs')
-rw-r--r--projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs b/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs
new file mode 100644
index 0000000..e44fd83
--- /dev/null
+++ b/projecttemplates/RelyingPartyLogic/Model.AuthenticationToken.cs
@@ -0,0 +1,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;
+ }
+ }
+}