private static OwaClientSecurityContextIdentity InternalCreateFromClientSecurityContextIdentity(ClientSecurityContextIdentity cscIdentity, string logonName, OrganizationId userOrganizationId = null)
        {
            SidBasedIdentity sidBasedIdentity = cscIdentity as SidBasedIdentity;

            if (sidBasedIdentity != null)
            {
                OwaClientSecurityContextIdentity.PrePopulateUserGroupSids(sidBasedIdentity);
            }
            OwaClientSecurityContextIdentity result;

            try
            {
                using (ClientSecurityContext clientSecurityContext = cscIdentity.CreateClientSecurityContext())
                {
                    result = new OwaClientSecurityContextIdentity(clientSecurityContext, logonName, cscIdentity.AuthenticationType, userOrganizationId);
                }
            }
            catch (AuthzException ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string, string, AuthzException>(0L, "OwaClientSecurityContextIdentity.CreateFromClientSecurityContextIdentity for ClientSecurityContextIdentity.Name={0} ClientSecurityContextIdentity.AuthenticationType={1} failed with exception: {2}", cscIdentity.Name, cscIdentity.AuthenticationType, ex);
                if (ex.InnerException is Win32Exception)
                {
                    throw new OwaIdentityException("There was a problem creating the Client Security Context.", ex);
                }
                throw;
            }
            return(result);
        }
        // Token: 0x06000D59 RID: 3417 RVA: 0x00059534 File Offset: 0x00057734
        internal static OwaClientSecurityContextIdentity CreateFromClientSecurityContextIdentity(ClientSecurityContextIdentity cscIdentity)
        {
            ClientSecurityContext clientSecurityContext = cscIdentity.CreateClientSecurityContext();

            return(new OwaClientSecurityContextIdentity(clientSecurityContext, cscIdentity.Name, cscIdentity.AuthenticationType));
        }