Exemplo n.º 1
0
        public async Task <ILoginSession> LogonAsync(string email, string password)
        {
            var result = default(ILoginSession);

            if (Adapter == AdapterType.Controller)
            {
                result = await Logic.Modules.Account.AccountManager.LogonAsync(email, password).ConfigureAwait(false);
            }
            else if (Adapter == AdapterType.Service)
            {
                var serviceInvoker = new Service.InvokeServiceAdapter(BaseUri);

                result = await serviceInvoker.LogonAsync(email, password).ConfigureAwait(false);
            }
            return(result);
        }
Exemplo n.º 2
0
        public async Task <ILoginSession> LogonAsync(string jsonWebToken)
        {
            var result = default(ILoginSession);

            if (Adapter == AdapterType.Controller)
            {
                var accountManager = Logic.Factory.CreateAccountManager();

                result = await accountManager.LogonAsync(jsonWebToken).ConfigureAwait(false);
            }
            else if (Adapter == AdapterType.Service)
            {
                var logon = new JsonWebLogon {
                    Token = jsonWebToken
                };
                using var serviceInvoker = new Service.InvokeServiceAdapter(BaseUri);

                result = await serviceInvoker.LogonAsync(logon).ConfigureAwait(false);
            }
            return(result);
        }
Exemplo n.º 3
0
        public async Task <ILoginSession> LogonAsync(string email, string password, string optionalInfo)
        {
            var result = default(ILoginSession);

            if (Adapter == AdapterType.Controller)
            {
                var accountManager = Logic.Factory.CreateAccountManager();

                result = await accountManager.LogonAsync(email, password, optionalInfo).ConfigureAwait(false);
            }
            else if (Adapter == AdapterType.Service)
            {
                var logon = new Logon
                {
                    Email        = email,
                    Password     = password,
                    OptionalInfo = optionalInfo,
                };
                using var serviceInvoker = new Service.InvokeServiceAdapter(BaseUri);

                result = await serviceInvoker.LogonAsync(logon).ConfigureAwait(false);
            }
            return(result);
        }