long huynh
long huynh

Reputation: 67

Servicestack Authentication get auth/logout

I'm noob to this and I'm trying to use auth/logout to log the user out from everywhere that the user is authenticated from the client. I get the respond 200 that the get request made through, but when I check test-webpage.com site the user is still logged inn.

Request URL:http://test-webpage.com/api/authenticate/logout

Request Method:GET

Status Code:200 OK

Remote Address:[::1]:80

Somehow the url works if I put it in the addressbar..

EDIT:

I noticed that the request ss-id is empty when I'm sending a post/get to the other client. Can this be a bug or something? When I'm authenticate to the other client. I can see that my client is sending an request and within that request it contain ss-id, ss-opt and ss-pid. But when sending a post/get auth/logout the request/respond's ss-id, ss-opt and ss-pid are empty. I'm debugging in chrome.

Upvotes: 1

Views: 281

Answers (1)

mythz
mythz

Reputation: 143284

To logout a user in ServiceStack you need to send an empty POST request to /auth/logout or if using the C# Service Clients:

client.Post(new Authenticate { provider = "logout" });

Upvotes: 1

Related Questions