简体   繁体   中英

Symfony2 - Authentication login… service

I had this application (running already on prod) for a while. The thing is that as a new project for this application I need to add a couple of rest services for authenticated users. Currently the security is handled by Sf2 (doctrine2 user provider). Pretty standard stuff.

So i been thinking about creating a new entity with a Token field (randomly created) and User. (since this sessions needed to persist). And then on my new controller who will provide the rest responses (json) add this token as a param, adding also one that will take user/password and return a new token.

That's my idea, but maybe there is a better way of doing so, more standard or some kind of provider. Any suggestions are welcome

在专用路由(例如/ api)下使用FOSRestBundle实现您的Web服务,并使用FOSOAuthServerBundle保护它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM