示例#1
0
        public async Task logout_request_with_params_but_user_no_longer_authenticated_should_pass_redirect_info_to_logout()
        {
            await _mockPipeline.LoginAsync("bob");

            var authorization = await _mockPipeline.RequestAuthorizationEndpointAsync(
                clientId : "client2",
                responseType : "id_token",
                scope : "openid",
                redirectUri : "https://client2/callback",
                state : "123_state",
                nonce : "123_nonce");

            var id_token = authorization.IdentityToken;

            _mockPipeline.RemoveLoginCookie();

            var response = await _mockPipeline.BrowserClient.GetAsync(IdentityServerPipeline.EndSessionEndpoint +
                                                                      "?id_token_hint=" + id_token +
                                                                      "&post_logout_redirect_uri=https://client2/signout-callback2");

            _mockPipeline.LogoutWasCalled.Should().BeTrue();
            _mockPipeline.LogoutRequest.Should().NotBeNull();
            _mockPipeline.LogoutRequest.ClientId.Should().Be("client2");
            _mockPipeline.LogoutRequest.PostLogoutRedirectUri.Should().Be("https://client2/signout-callback2");
            _mockPipeline.LogoutRequest.SignOutIFrameUrl.Should().BeNull();
        }
示例#2
0
    public async Task getsessions_on_ticket_store_should_use_session_store()
    {
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();
        await _pipeline.LoginAsync("alice");

        _pipeline.RemoveLoginCookie();

        var tickets = await _ticketService.GetSessionsAsync(new SessionFilter { SubjectId = "alice" });

        var sessions = await _sessionStore.GetSessionsAsync(new SessionFilter { SubjectId = "alice" });

        tickets.Select(x => x.SessionId).Should().BeEquivalentTo(sessions.Select(x => x.SessionId));
    }