示例#1
0
        IAuthenticationResult IApplicationSync.AuthenticateAccount(Action <UsernamePasswordRequestBuilder> requestBuilder)
        {
            var builder = new UsernamePasswordRequestBuilder();

            requestBuilder(builder);
            var request = builder.Build();

            return(this.AsSyncInterface.AuthenticateAccount(request));
        }
示例#2
0
        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));
        }
示例#4
0
        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();
        }