116 Star 908 Fork 234

dromara / sureness

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
custom-subject-creator.md 1.16 KB
Copy Edit Raw Blame History
tomsun28 authored 2021-02-21 21:32 . Feature update english docs (#67)

custom subject creator

Custom subject creator is our most frequently used extension. When the request body object is not a servlet or jax-rs standard api, we need to customize the subject creator, make it obtain the request information we need (request path, request method, authentication information, etc.) through the request object, thereby creating the corresponding subject.

Sureness has built-in BasicSubjectServletCreator that can create PasswordSubject based on account password, and create the JwtSubjectServletCreator of the jwt type JwtSubject, etc.
Of course, we can customize the subjectCreator we need to create the subject.

Before customization, it is recommended to understand the sureness's process and the extended interface provided, see Advanced Extension for details.

  • SubjectCreate: Create a Subject interface and create different types of Subject objects according to the request content.

Implement the SubjectCreate interface method, and create the corresponding subject according to different request objects.

Detail please refer to sample-spring-webflux-sureness

Java
1
https://gitee.com/dromara/sureness.git
git@gitee.com:dromara/sureness.git
dromara
sureness
sureness
master

Search