What are the simple and effective methods for verifying public and private mixed APIs?

Source: Internet
Author: User
Currently, a resetfulapi is used by mobile apps. Most of the APP content can be viewed without logon. However, some of the content can be used only after a registered user logs on, is there any way to verify the authenticity of the user after login? I thought about returning an access_token (custom, non-oa... currently, a resetful api is used by mobile apps. Most of the APP content can be viewed without logon, but some of it can be used only after a registered user logs on, is there any way to verify the authenticity of the user after login? I thought about returning an access_token (custom, non-oauth method), but I still feel that there is a risk of fraudulent use. Is there any way to verify the authenticity of this user rather than impersonating access_token?

Reply content:

Currently, a resetful api is used by mobile apps. Most of the APP content can be viewed without logon, but some of it can be used only after a registered user logs on, is there any way to verify the authenticity of the user after login? I thought about returning an access_token (custom, non-oauth method), but I still feel that there is a risk of fraudulent use. Is there any way to verify the authenticity of this user rather than impersonating access_token?

This is a typical exampleHow can I prove that I am my problem?There is no absolute security method. You can only increase the difficulty to improve the security. There are many methods. The token you mentioned is one of the common methods. In addition, the simplest and most effective method is to use https for encrypted transmission. Others, such as passwords and dynamic passwords, are required for important operations each time.

The above is a technical approach, and there is also a non-technical security means, more belongs to the scope of Sociology (of course, it must be achieved through technical means in the end ). For example, the feature library. Each user has a set of features to identify. As the number of times of use increases, the collection of such features will become more detailed. Then the system can use these features to verify whether the user is himself or herself. For example, users' usual logon locations, mobile phone device features, input habits, usage habits, and interests. These are like fingerprints of a person, which are hard to forge. However, this is not so easy to implement.

Security is like this. The relationship between the spear and the shield does not have an indestructible spear, nor is there an absolute Defensive Shield. Everything should be compromised. As long as the cost of cracking is greater than the benefits obtained after the attack, the system can be considered safe.

If resetful is stateless, there is a possibility of exploitation.

Use the same encryption method as the client to generate tokens.
The token is invalid and is rejected directly.
The verification is passed. Based on the information, for example, if the user id is 1, the server decrypts the code and determines whether the user id = 1 is logged on.
If the client is decompiled and the algorithm is known, you still need to log on because the logon information is on the server.
Theoretically, if each token is different, there is no possibility of packet capture, which makes no sense.

Private APIs can use tokens to authenticate user identities, control the frequency of user requests, and avoid API abuse.

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.