Exemplo n.º 1
0
        public IGroupPrincipal Create(IPrincipalContext principalContext,
                                      string groupName)
        {
            var groupPrincipal = GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName);

            return(new GroupPrincipalWrap(groupPrincipal));
        }
 public BasicAuthentication(IAuthenticationSession session, IPrincipalContext context, IPrincipalBuilder builder, ICredentialsAuthenticator authenticator)
 {
     _session = session;
     _context = context;
     _builder = builder;
     _authenticator = authenticator;
 }
Exemplo n.º 3
0
 public BasicAuthentication(IAuthenticationSession session, IPrincipalContext context, IPrincipalBuilder builder, ICredentialsAuthenticator authenticator, ILockedOutRule lockedOutRule)
 {
     _session = session;
     _context = context;
     _builder = builder;
     _authenticator = authenticator;
     _lockedOutRule = lockedOutRule;
 }
 public BasicAuthentication(IAuthenticationSession session, IPrincipalContext context, IPrincipalBuilder builder, ICredentialsAuthenticator authenticator, ILockedOutRule lockedOutRule)
 {
     _session       = session;
     _context       = context;
     _builder       = builder;
     _authenticator = authenticator;
     _lockedOutRule = lockedOutRule;
 }
        public static PrincipalContext GetPrincipalContext(this object value, IPrincipalContext principalContext, bool throwExceptionIfUnsuccessful)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            return(Instance.GetPrincipalContext(principalContext, throwExceptionIfUnsuccessful));
        }
Exemplo n.º 6
0
 public SamlDirector(IPrincipalBuilder principalBuilder, IAuthenticationSession session, IPrincipalContext context)
 {
     _principalBuilder = principalBuilder;
     _session          = session;
     _context          = context;
     _result           = new AuthResult
     {
         Success      = false,
         Continuation =
             FubuContinuation.RedirectTo(new LoginRequest
         {
             Message = SamlValidationKeys.UnableToValidationSamlResponse
         }, "GET")
     };
 }
Exemplo n.º 7
0
 public SamlDirector(IPrincipalBuilder principalBuilder, IAuthenticationSession session, IPrincipalContext context)
 {
     _principalBuilder = principalBuilder;
     _session = session;
     _context = context;
     _result = new AuthResult
     {
         Success = false,
         Continuation =
             FubuContinuation.RedirectTo(new LoginRequest
             {
                 Message = SamlValidationKeys.UnableToValidationSamlResponse
             }, "GET")
     };
 }
        public PrincipalSearchResult(IEnumerable <T> items, IPrincipalContext principalContext, bool disposePrincipalContextOnDispose)
        {
            if (items == null)
            {
                throw new ArgumentNullException("items");
            }

            if (principalContext == null)
            {
                throw new ArgumentNullException("principalContext");
            }

            this._disposePrincipalContextOnDispose = disposePrincipalContextOnDispose;
            this._items            = items.ToArray();  // To avoid having problems with PrincipalSearchResult already being disposed.
            this._principalContext = principalContext;
        }
Exemplo n.º 9
0
        public virtual PrincipalContext GetPrincipalContext(IPrincipalContext principalContext, bool throwExceptionIfUnsuccessful)
        {
            if (principalContext == null)
            {
                return(null);
            }

            var principalContextInternal = principalContext as IPrincipalContextInternal;

            if (principalContextInternal != null)
            {
                return(principalContextInternal.PrincipalContext);
            }

            if (throwExceptionIfUnsuccessful)
            {
                throw new NotImplementedException(string.Format(CultureInfo.InvariantCulture, "The object of type \"{0}\" does not implement \"{1}\".", principalContext.GetType(), typeof(IPrincipalContextInternal)));
            }

            return(null);
        }
 public MembershipAuthentication(IAuthenticationSession session, IPrincipalContext context, IMembershipRepository membership, ILockedOutRule lockedOutRule)
 {
     _membership = membership;
     _inner = new BasicAuthentication(session, context, this, this, lockedOutRule);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="principalContext"></param>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public static IGroupPrincipal FindByIdentity(IPrincipalContext principalContext,
                                              string groupName)
 {
     return new GroupPrincipalWrap(GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName));
 }
Exemplo n.º 12
0
 public virtual PrincipalContext GetPrincipalContext(IPrincipalContext principalContext)
 {
     return(this.GetPrincipalContext(principalContext, true));
 }
Exemplo n.º 13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 /// <param name="identityType"></param>
 /// <param name="identityValue"></param>
 public void Add(IPrincipalContext context,
                 IdentityType identityType,
                 string identityValue)
 {
     this.principalCollection.Add(context.PrincipalContextInstance, identityType, identityValue);
 }
 public AuthenticationContext(IPrincipalCreator principalCreator,
                              IPrincipalContext principalContext)
 {
     this.principalCreator = principalCreator;
     this.principalContext = principalContext;
 }
Exemplo n.º 15
0
 public MembershipAuthentication(IAuthenticationSession session, IPrincipalContext context, IMembershipRepository membership, ILockedOutRule lockedOutRule)
 {
     _membership = membership;
     _inner      = new BasicAuthentication(session, context, this, this, lockedOutRule);
 }
Exemplo n.º 16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="principalContext"></param>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public static IGroupPrincipal FindByIdentity(IPrincipalContext principalContext,
                                              string groupName)
 {
     return(new GroupPrincipalWrap(GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName)));
 }
 public AuthenticationContext(IPrincipalCreator principalCreator,
                              IPrincipalContext principalContext)
 {
     this.principalCreator = principalCreator;
     this.principalContext = principalContext;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="context"></param>
 /// <param name="identityType"></param>
 /// <param name="identityValue"></param>
 public void Add(IPrincipalContext context,
                 IdentityType identityType,
                 string identityValue)
 {
     this.principalCollection.Add(context.PrincipalContextInstance, identityType, identityValue);
 }
 public IGroupPrincipal Create(IPrincipalContext principalContext,
                               string groupName)
 {
     var groupPrincipal = GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName);
     return new GroupPrincipalWrap(groupPrincipal);
 }