コード例 #1
0
        public IGroupPrincipal Create(IPrincipalContext principalContext,
                                      string groupName)
        {
            var groupPrincipal = GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName);

            return(new GroupPrincipalWrap(groupPrincipal));
        }
コード例 #2
0
 public BasicAuthentication(IAuthenticationSession session, IPrincipalContext context, IPrincipalBuilder builder, ICredentialsAuthenticator authenticator)
 {
     _session = session;
     _context = context;
     _builder = builder;
     _authenticator = authenticator;
 }
コード例 #3
0
 public BasicAuthentication(IAuthenticationSession session, IPrincipalContext context, IPrincipalBuilder builder, ICredentialsAuthenticator authenticator, ILockedOutRule lockedOutRule)
 {
     _session = session;
     _context = context;
     _builder = builder;
     _authenticator = authenticator;
     _lockedOutRule = lockedOutRule;
 }
コード例 #4
0
 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));
        }
コード例 #6
0
ファイル: SamlDirector.cs プロジェクト: kalash-/FubuMVC.Saml2
 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")
     };
 }
コード例 #7
0
ファイル: SamlDirector.cs プロジェクト: RyanHauert/fubumvc
 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;
        }
コード例 #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);
        }
コード例 #10
0
 public MembershipAuthentication(IAuthenticationSession session, IPrincipalContext context, IMembershipRepository membership, ILockedOutRule lockedOutRule)
 {
     _membership = membership;
     _inner = new BasicAuthentication(session, context, this, this, lockedOutRule);
 }
コード例 #11
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));
 }
コード例 #12
0
 public virtual PrincipalContext GetPrincipalContext(IPrincipalContext principalContext)
 {
     return(this.GetPrincipalContext(principalContext, true));
 }
コード例 #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;
 }
コード例 #15
0
 public MembershipAuthentication(IAuthenticationSession session, IPrincipalContext context, IMembershipRepository membership, ILockedOutRule lockedOutRule)
 {
     _membership = membership;
     _inner      = new BasicAuthentication(session, context, this, this, lockedOutRule);
 }
コード例 #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;
 }
コード例 #18
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);
 }
コード例 #19
0
 public IGroupPrincipal Create(IPrincipalContext principalContext,
                               string groupName)
 {
     var groupPrincipal = GroupPrincipal.FindByIdentity(principalContext.PrincipalContextInstance, groupName);
     return new GroupPrincipalWrap(groupPrincipal);
 }