How to design a acess_token mechanism?

Source: Internet
Author: User
To verify the validity of the user
Need to add a acess_token mechanism

The little brother didn't want to know how to store this thing?

If user a asks for the first time to assign him a acess_token = a (denoted by a). Then put this a and build time into the database?

Then user a next time to verify from the database to query whether a is expired? Return an error code if it expires? Is this the path? Ask for advice


Reply to discussion (solution)

Can be passed by cookie, form hidden field, url parameter, or embedded in API
Whether you want to store it in a database depends on the lifetime of your token
Tokens are usually used as a supplement to a cookie or session and are issued temporarily

Can be passed by cookie, form hidden field, url parameter, or embedded in API
Whether you want to store it in a database depends on the lifetime of your token
Tokens are usually used as a supplement to a cookie or session and are issued temporarily
Thank you for your reply. I'm going to make an API interface.
I'll think again!

What kind of storage mechanism is acess_token in a similar API?
Do you know anything about that, thank you.

This acess_token is generally issued temporarily (after successful login)
The General API user is large, the issued Acess_token contains the time information
You don't have to bother with the database.

  • 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.