예제 #1
0
//=======================================================================================================
/// <summary>
///  Create valid security principal and identity.
/// </summary>
//=======================================================================================================
        private CinderPrincipal CreateValidPrincipal(DocFlockAuthenticationResponse response)
        {
            // Send back a valid principal and identity with the Authentication requests results.

            var user = new User(true)
            {
                Organization = this.GetOrganization(response.CustomerId),
                Email        = response.Email,
                Name         = response.FirstName + " " + response.LastName,
                Id           = response.UserId.ToString()
            };

           var newPrincipal = new CinderPrincipal(user);
           ApplicationContext.Principal = newPrincipal;

           return newPrincipal;
        }
예제 #2
0
//=======================================================================================================
/// <summary>
///  Create an empty security principal and identity.
/// </summary>
//=======================================================================================================
        private CinderPrincipal CreateEmptyPrincipal()
        {
            // Send back an  principal and identity which refelcts this state.

            var newIdentity  = new CinderIdentity(String.Empty, string.Empty, string.Empty, false);
            var newPrincipal = new CinderPrincipal(newIdentity);

            return newPrincipal;
        }