maximelian1986
maximelian1986

Reputation: 2462

Sisense logout with API call

I have problems with logging out user from Sisense. So I login using jwt and can see my dashboard using SisenseJS. And now I want to call logout (https://sisense/api/auth/logout). Sisense is located in another server inside same local network so have ip like 10.0.0.45 and I have maped it to "sisense" inside host file. All good.

Then if I just go to browser and put https://sisense/api/auth/logout inside address bar, it works. I also using self-signed certificate so it prompt me to "do you want to continue as this site is not trusted...bla bla bla". But problem starts when I call that endpoint from ajax

  $.ajax({
              method: "GET",
              contentType: 'application/json',
             url: "https://sisense/api/auth/logout"
    });

(actually I tried to call it from webclient inside controller also, and it does not need to be ajax call anything acceptable). So it returns 403 error. What I am doing wrong? Should I put some headers? Does any one have any experience on it?

Upvotes: 0

Views: 1297

Answers (1)

maximelian1986
maximelian1986

Reputation: 2462

Finally got it working.

So ajax call didn't worked, but redirection was the solution.

Added controller

public ActionResult SignOut()
        {
            return Redirect("https://sisenseAddress/api/v1/authentication/logout");
        } 

Also you may need to activate CORS on Sisesnse

And as you probably using some SSO like Azure you can put that Logout action url inside Sisense SSO settings as Logout endpoint. So it first do sisense logout and then go back to you site and do lets say Azure logout.

Upvotes: 1

Related Questions