예제 #1
0
        public bool Authenticate(NVIdentity identity)
        {
            if (string.IsNullOrEmpty(identity.Name) || string.IsNullOrEmpty(identity.Password))
            {
                return(false);
            }

            return(FSUtil.Authenticate(identity));
        }
예제 #2
0
        /// <summary>
        ///     Gets this instance.
        /// </summary>
        /// <returns></returns>
        internal static FSGlobalContext Get(NVIdentity identity)
        {
            //identity = identity ?? NVUserContext.Identity;

            var pool = _globalPools.GetOrAdd(identity.GetToken(), new Lazy <FSGlobalPool>(() =>
                                                                                          new FSGlobalPool(() => GenerateGlobal(identity), BrokerSettings.Default.GlobalPoolSize)
                                                                                          ));

            var global = pool.Value.GetGlobal() as IFSGlobalObjects;

            return(new FSGlobalContext(identity, global));
        }
예제 #3
0
        public static bool Authenticate(NVIdentity identity)
        {
            var global = FSGlobalFactory.Get(identity);

            if (global != null)
            {
                identity.IsAuthenticated = true;

                FSGlobalFactory.Put(global);

                return(true);
            }

            return(false);
        }
 public FSGlobalContext(NVIdentity identity, IFSGlobalObjects global)
 {
     Identity = identity;
     FSGlobal = global;
 }
예제 #5
0
 public FSScope(NVIdentity identity)
 {
     FSGlobalContext = FSGlobalFactory.Get(identity);
 }
        public static IFSGlobalObjects Authenticate(this IFSGlobalObjects global, NVIdentity identity)
        {
            cLoginFactory.Create(global).LoginServiceHost(identity.Name, identity.Password, identity.BusinessUnit);

            return(global);
        }
예제 #7
0
 public FSGlobal(NVIdentity identity, IFSGlobalObjects global)
 {
     Identity = identity;
     Global   = global;
 }
예제 #8
0
 internal static IFSGlobalObjects GenerateGlobal(NVIdentity identity)
 {
     return(((IFSGlobalObjects)GlobalObjectManager.CreateGlobalObject(guid.NewGuid().Value))
            .Authenticate(identity)
            .EnableCaching());
 }