Beispiel #1
0
        internal static IIdentity GetDelegatedIdentity(string delegatedStr)
        {
            string text;
            string text2;
            string text3;
            string text4;

            string[] array;
            if (!DelegatedPrincipal.TryParseDelegatedString(delegatedStr, out text, out text2, out text3, out text4, out array))
            {
                throw new ArgumentException("delegatedStr");
            }
            return(new GenericIdentity(DelegatedPrincipal.ToString(text, text2, text3, text4, array), DelegatedPrincipal.DelegatedAuthenticationType));
        }
Beispiel #2
0
        internal static bool TryParseDelegatedString(string delegatedStr, out DelegatedPrincipal principal)
        {
            principal = null;
            string text;
            string text2;
            string text3;
            string text4;

            string[] array;
            if (!DelegatedPrincipal.TryParseDelegatedString(delegatedStr, out text, out text2, out text3, out text4, out array))
            {
                return(false);
            }
            principal = new DelegatedPrincipal(delegatedStr, text, text2, text3, text4, array);
            return(true);
        }
Beispiel #3
0
 internal DelegatedPrincipal(IIdentity identity, string[] roles) : base(identity, roles)
 {
     if (identity == null)
     {
         throw new ArgumentNullException("identity");
     }
     if (string.IsNullOrEmpty(identity.Name))
     {
         throw new ArgumentNullException("identity.Name");
     }
     if (!(identity is GenericIdentity) || !DelegatedPrincipal.DelegatedAuthenticationType.Equals(identity.AuthenticationType, StringComparison.OrdinalIgnoreCase))
     {
         throw new ArgumentException("identity");
     }
     if (!DelegatedPrincipal.TryParseDelegatedString(identity.Name, out this.userId, out this.userOrgId, out this.delegatedOrg, out this.displayName, out this.groups))
     {
         throw new ArgumentException("identity.Name");
     }
 }
Beispiel #4
0
 internal static IIdentity GetDelegatedIdentity(string userId, string userOrgId, string targetOrg, string displayName, string[] groups)
 {
     return(new GenericIdentity(DelegatedPrincipal.ToString(userId, userOrgId, targetOrg, displayName, groups), DelegatedPrincipal.DelegatedAuthenticationType));
 }