public async Task <bool> FetchPermissionsAndUserValues() { bool result = false; this.permissionServerClient.AddAuthenticationHeader(this.sessionService.AccessToken); bool hasFetchedPermissionsSuccessully = await permissionServerClient.FetchPermissions(); bool hasFetchedUserValuesSuccessfully = await permissionServerClient.FetchUserValues(); result = hasFetchedPermissionsSuccessully /*&& hasFetchedUserValuesSuccessfully*/; //user values not important / necessary return(result); }
private async Task loginAndFetchPermissions() { bool couldFetchIdentity = await this.identityService.FetchIdentity(this.Username, this.SecurePassword); if (couldFetchIdentity) { this.permissionServerClient.AddAuthenticationHeader(this.sessionService.AccessToken); bool hasFetchedPermissionsSuccessully = await permissionServerClient.FetchPermissions(); bool hasFetchedUserValuesSuccessfully = await permissionServerClient.FetchUserValues(); if (hasFetchedPermissionsSuccessully) { this.sessionService.SetUser(await this.permissionServerClient.GetUserAsync()); //TODO: check, is this needed anyway? Local copy of user bool?hasNavigated = this.navigationService?.Navigate("UserInfoViewModel"); if (hasNavigated == true) { //send a signal to MainViewModel to show menu bar this.SendMessage("ShowMenu"); } else if (hasNavigated == false) { this.Hint = "Unfortunately, your user has been verified, but this app is not able to bring you to the next page. Please try again."; } else { this.Hint = "Unfortunately, your user has been verified, but this app is not able to bring you to the next page as something weird has happened. Please try again."; } } else { this.Hint = "Unfortunately, you are not authorized to progress."; } } else { this.Hint = "Unfortunately, the identity of the user could not be fetched."; } }