From 477deb4093a835a23ff76d62a12ac8c7bb8bb6c0 Mon Sep 17 00:00:00 2001 From: Alexander Yumashev <33555768+alex-jitbit@users.noreply.github.com> Date: Thu, 24 Sep 2020 12:04:30 +0300 Subject: [PATCH] Virtual methods for easier overriding fixes #44 --- Saml.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Saml.cs b/Saml.cs index 8218f3e..c6df6a3 100644 --- a/Saml.cs +++ b/Saml.cs @@ -164,19 +164,19 @@ public string GetNameID() return node.InnerText; } - public string GetUpn() + public virtual string GetUpn() { return GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"); } - public string GetEmail() + public virtual string GetEmail() { return GetCustomAttribute("User.email") ?? GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress") //some providers (for example Azure AD) put last name into an attribute named "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" ?? GetCustomAttribute("mail"); //some providers put last name into an attribute named "mail" } - public string GetFirstName() + public virtual string GetFirstName() { return GetCustomAttribute("first_name") ?? GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname") //some providers (for example Azure AD) put last name into an attribute named "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" @@ -184,7 +184,7 @@ public string GetFirstName() ?? GetCustomAttribute("givenName"); //some providers put last name into an attribute named "givenName" } - public string GetLastName() + public virtual string GetLastName() { return GetCustomAttribute("last_name") ?? GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname") //some providers (for example Azure AD) put last name into an attribute named "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" @@ -192,18 +192,18 @@ public string GetLastName() ?? GetCustomAttribute("sn"); //some providers put last name into an attribute named "sn" } - public string GetDepartment() + public virtual string GetDepartment() { return GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/department"); } - public string GetPhone() + public virtual string GetPhone() { return GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone") ?? GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/telephonenumber"); } - public string GetCompany() + public virtual string GetCompany() { return GetCustomAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/companyname") ?? GetCustomAttribute("User.CompanyName");