IAuthenticationResult IApplicationSync.AuthenticateAccount(Action <UsernamePasswordRequestBuilder> requestBuilder) { var builder = new UsernamePasswordRequestBuilder(); requestBuilder(builder); var request = builder.Build(); return(this.AsSyncInterface.AuthenticateAccount(request)); }
IAuthenticationResult IApplicationSync.AuthenticateAccount(Action <UsernamePasswordRequestBuilder> requestBuilder, Action <IRetrievalOptions <IAuthenticationResult> > responseOptions) { var builder = new UsernamePasswordRequestBuilder(); requestBuilder(builder); var request = builder.Build(); return(this.AsSyncInterface.AuthenticateAccount(request, responseOptions)); }
Task <IAuthenticationResult> IApplication.AuthenticateAccountAsync(Action <UsernamePasswordRequestBuilder> requestBuilder, Action <IRetrievalOptions <IAuthenticationResult> > responseOptions, CancellationToken cancellationToken) { var builder = new UsernamePasswordRequestBuilder(); requestBuilder(builder); var request = builder.Build(); return(this.AsInterface.AuthenticateAccountAsync(request, responseOptions, cancellationToken)); }
public async Task Authenticating_account_with_response_options(TestClientProvider clientBuilder) { var client = clientBuilder.GetClient(); var application = await client.GetResourceAsync <IApplication>(this.fixture.PrimaryApplicationHref); var request = new UsernamePasswordRequestBuilder(); request.SetUsernameOrEmail($"sonofthesuns-{this.fixture.TestRunIdentifier}"); request.SetPassword("whataPieceofjunk$1138"); var result = await application.AuthenticateAccountAsync(request.Build(), response => response.Expand(x => x.GetAccount())); result.ShouldBeAssignableTo <IAuthenticationResult>(); result.Success.ShouldBeTrue(); }