Springboot Project uses Swagger2 exposed Resftul interface to increase JWT for security verification

Source: Internet
Author: User

Two articles are recommended first:

Some introduction to the protection of Restapi:

Http://www.jianshu.com/p/6307c89fe3fa

Some of the differences between token and session:

Http://www.jianshu.com/p/576dbf44b2ae

http://blog.csdn.net/sun_t89/article/details/51923017

1. Background:

Swagger2 convenient for us to maintain and test our restful interface, but in the test to find the user information previously saved with the session, here in the interface test found unable to save the user's URL as postman to save the session. A little brother in the group recommended Swagger2 and JWT to implement the interface test for this function, let's take a look at how to implement it today.

2. What is JWT?

After Springboot integrated Swagger2, Swagger2 exposed the RESTful interface, where JWT was added to protect the API .

JWT is a concise, URL-safe declarative statement of security information between two users . (similar to Postman saves the link to the URL we have verified, you can use the result of the previous step directly in the next test)

JWT (Json Web Token)As an open standard (RFC 7519), a concise, self-contained method is defined for communicating the security information between two parties in the form of a JSON object, which is digitally signed when the message is safe, and the JWT is signed with the RSA public key.

3. How does springboot integrate with JWT?

4. Swagger2 How to test and save user information with JWT.

Springboot Project uses Swagger2 exposed Resftul interface to increase JWT for security verification

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.