Ejemplo n.º 1
0
        public bool Authenticate(NVIdentity identity)
        {
            if (string.IsNullOrEmpty(identity.Name) || string.IsNullOrEmpty(identity.Password))
            {
                return(false);
            }

            return(FSUtil.Authenticate(identity));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 public FSScope(NVIdentity identity)
 {
     FSGlobalContext = FSGlobalFactory.Get(identity);
 }
Ejemplo n.º 6
0
        public static IFSGlobalObjects Authenticate(this IFSGlobalObjects global, NVIdentity identity)
        {
            cLoginFactory.Create(global).LoginServiceHost(identity.Name, identity.Password, identity.BusinessUnit);

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