YII2 RESTful authentication Issues

Source: Internet
Author: User
YII2 uses restful mode, no cookie, where does Authkey get it? In restful mode, every visit comes with Access_token, but there is no authkey, is there any need for Authkey?

Reply content:

YII2 uses restful mode, no cookie, where does Authkey get it? In restful mode, every visit comes with Access_token, but there is no authkey, is there any need for Authkey?

The implementation according to yii-app-advanced:

  • User.auth_key only one, used to log in from a cookie

  • The user table does not have a access_token field

In practice, a user will have more than one access_token, so another table is needed to store it;

This is two things, don't mix it up.

Specifically in the framework of YII and rest interface How to do authentication, can refer to:

  • Yii\rest\controller::behaviors () [Authenticator]

  • Yii\filters\auth\compositeauth

  • Yii\filters\auth\queryparamauth

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.