/// <summary> /// Registers new user using custom register controller. Access is to authorized requests is not granted. /// Call <see cref="Login(string, string)"/> method for this purpose. /// </summary> /// <param name="email">The email.</param> /// <param name="password">The password.</param> /// <returns>Registration result.</returns> public async Task <RegistrationResult> Register(string email, string password) { var registrationRequest = new RegistrationRequest() { UserId = email, Password = password }; var ret = await _mobileServiceClient.InvokeApiAsync <RegistrationRequest, RegistrationResult>( _customRegistrationControllerName, registrationRequest); return(ret); }
private async Task <string> CustomProviderAuthentication(RefreshTokenInfo refreshTokenInfo) { try { var ret = await _mobileServiceClient.InvokeApiAsync <CustomLoginResult>( _customLoginControllerName, HttpMethod.Get, new Dictionary <string, string> { { "userId", refreshTokenInfo.UserId }, { "refreshToken", refreshTokenInfo.RefreshToken } }); if (ret != null) { _mobileServiceClient.CurrentUser = new MobileServiceUser(ret.UserId) { MobileServiceAuthenticationToken = ret.MobileServiceAuthenticationToken }; refreshTokenInfo.RefreshToken = ret.RefreshToken; _accountStoreService.StoreTokenInSecureStore(refreshTokenInfo); return(_mobileServiceClient.CurrentUser.MobileServiceAuthenticationToken); } else { return(string.Empty); } } catch (MobileServiceInvalidOperationException) { return(string.Empty); } }
public async Task Verify() { await _mobileServiceClient.InvokeApiAsync(_verificationControllerName); }
public async Task <JToken> GetCurrentAccountInformation() => await _mobileServiceClient.InvokeApiAsync(_accountsControllerName);