public SchoolSoftSchoolPlatformClient(UserCrededentials userCrededentials) : base(userCrededentials)
        {
            var assemblyBuilder      = new AssemblyComponentRegistrator(typeof(SchoolSoftSchoolPlatformClient).Assembly);   //Registers all componenets etc
            var navigatorRegistrator = new InstanceComponentRegistrator <HttpClient>(new SchoolSoftNavigatorBuilder(this)); //Register http client navigator

            BuildContainer(assemblyBuilder, navigatorRegistrator);
        }
        public override async Task <LoginResult> LoginAsync(UserCrededentials crededentials)
        {
            const string route = "/Login.jsp";

            var result = await navigator.PostAsync(route, new FormUrlEncodedContent(new Dictionary <string, string>()
            {
                { "action", "login" },
                { "usertype", crededentials.AccountType },
                { "ssusername", crededentials.Username },
                { "sspassword", crededentials.Password },
                { "button", "Logga in" }
            }));

            if (result.StatusCode == System.Net.HttpStatusCode.OK)
            {
                return(LoginResult.Build(false));
            }

            return(LoginResult.Build(true));
        }
 public BaseSchoolPlatformClient(UserCrededentials userCrededentials)
 {
     this.Crededentials = userCrededentials;
 }
示例#4
0
 public abstract Task <LoginResult> LoginAsync(UserCrededentials crededentials);