Symfony2 and Angular. User authentication

后端 未结 3 1471
滥情空心
滥情空心 2021-02-04 17:40

I am developing a web application that involves Symfony2 and AngularJs. I have a question about the right way of authenticate users in the site.

I have built a function

3条回答
  •  名媛妹妹
    2021-02-04 17:55

    The bundle you linked is a better solution than your current.
    It's because of the differences between security needs of a REST Api and a classic form-based application.

    Look at the jwt.io introduction to Json Web Token, and after, you should try to implement the LexikJWTAuthenticationBundle which is very clean, easy-to-use, securely and powerful.

    JWT will provide more security and a ready-to-use login process, only need a few lines of configuration. Of course, you can easily manage, register and create token from users retrieved/registered by your user provider (for me it's the FOSUserBundle).

    A JWT is a real signature representing your user. Read more in the link I've given you.

    See also this JWTAuthenticationBundle Sandbox for a real example with AngularJS.

提交回复
热议问题