I have an Identity server 4 application, servral asp .net core applications and a Javascript application. I have enabled back channel logout on the asp .net core applications. This way if one of the applications logs out they are all logged out almost instantly.

The issue i am having is with the JavaScript application it will need to poll the identity server every minute to ensure that the user is still logged in. 

Example: 

User is logged in on Asp .net core app 1, Asp .net core app 2, and Javascript app. Note these are financial applications a user needs to know that if they log out of one application then they log out of them all when they leave their desk.

They are logged into the identity server which granted each of those applications tokens. The user then logs out of Asp .net core app 1. The back channel logout notifies Asp .net core app 2 that the user is now logged out and logs that out as well. 

The JavaScript app needs to be logged out as well. The only way i can think of doing this is by polling the identity server to see if the user has been logged out or not. If they have then i will need to sign them out of the JavaScript app. 

JavaScript timer
================

I have created a timer that currently runs every second calling the identity server

```
setInterval(myTimer, 1000);
function myTimer() {
    mgr.getUser().then(function (user) {

        //var url = config.authority + "/connect/userinfo";
        var url = config.authority + "/api/user/LoggedIn";
        var xhttp = new XMLHttpRequest();

        xhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                alert(this.responseText);
            }
        };

        xhttp.open("GET", url);
        xhttp.setRequestHeader("Authorization", "Bearer " + user.access_token);
        xhttp.send();
    });

}

```

Identity server endpoint
========================

I have created an api endpoint on the identity server that checks if the user is authorized.

```
[Route("api/[controller]")]
[ApiController]
public class UserController : ControllerBase
{

    [HttpGet("LoggedIn")]
    public IActionResult LoggedIn()
    {
        return Ok(new { IsLoggedIn = User.Identity.IsAuthenticated });
    }
}

```

The problem is because this api endpoint is not loading the user identity. `User.Identity.IsAuthenticated` its coming back as false even when the user is logged in on the identity server.

How check if the user is still logged into the identity server? Is there a better endpoint that will already tell me if the user has an active session and is logged in? I tried the userinfo endpoint but by passing that a valid access token it just returns true and even when the user has now been logged out. Isn't there a way to find out if the auth session on the identity server itself from JavaScript?