예제 #1
0
        public static IIdentity GetCallerIdentity(HttpContext httpContext)
        {
            ADRawEntry         callerAdEntry      = LiveIdBasicHelper.GetCallerAdEntry(httpContext);
            SecurityIdentifier securityIdentifier = callerAdEntry[ADMailboxRecipientSchema.Sid] as SecurityIdentifier;
            OrganizationId     organizationId     = (OrganizationId)callerAdEntry[ADObjectSchema.OrganizationId];

            return(new GenericSidIdentity(securityIdentifier.ToString(), "LiveIdBasic", securityIdentifier, organizationId.PartitionId.ToString()));
        }
예제 #2
0
        public static IIdentity GetCallerIdentity(this HttpContext httpContext)
        {
            IIdentity identity = httpContext.User.Identity;

            if (identity.GetType().Equals(typeof(GenericIdentity)) && string.Equals(identity.AuthenticationType, "LiveIdBasic", StringComparison.OrdinalIgnoreCase))
            {
                identity = LiveIdBasicHelper.GetCallerIdentity(httpContext);
            }
            return(identity);
        }