Session for secure api: session not written

瀏覽次數:24 次
跳到第一則未讀訊息

Reutan

未讀,
2015年3月2日 清晨7:39:402015/3/2
收件者:sai...@googlegroups.com
Hi !

I use the last version of Sails (0.11) and only the back end for API.

I have an API with user and I want secure this API.
So I use  req.session.authenticated to control that (in my policy).

But I think my session is not written because  req.session.authenticated is null in my policy.

My test project is here : https://bitbucket.org/kapik/test-sails/

Do you have an idea of this problem ??

Thank in advance for your help !

juantonio v

未讀,
2015年3月2日 晚上10:57:192015/3/2
收件者:sai...@googlegroups.com
Im speak spanish sorry my english,

when creating the session write req.session.authenticated =true;

and redirects (res.redirect ('tu / path'))


Reutan

未讀,
2015年3月3日 清晨7:13:372015/3/3
收件者:sai...@googlegroups.com
I don't need redirection: I use the back end only.
My workflow:
  • I use /login to authenticate the user: the session server know the user and set session.authenticated = true
  • Next I use /user to retrieve users: session.authenticated == true so I should be able to retrieve this data but session is not correctly set

Session is a back-end session ??
If not, I have to use a solution with token.

What do you think ?
回覆所有人
回覆作者
轉寄
0 則新訊息