https://github.com/nhomble/spring-security-openapi-demo
try out the new preauthorize feature in openapispec
https://github.com/nhomble/spring-security-openapi-demo
Last synced: 3 months ago
JSON representation
try out the new preauthorize feature in openapispec
- Host: GitHub
- URL: https://github.com/nhomble/spring-security-openapi-demo
- Owner: nhomble
- Created: 2020-05-22T06:33:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-18T20:33:57.000Z (about 1 year ago)
- Last Synced: 2025-01-21T00:47:23.420Z (5 months ago)
- Language: Java
- Size: 60.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring security openapi-spec demo
The code was first generated fromAnd then we made the following changes
#### 1. Add spring-security-spring-boot-starter to pom
Pulled in newer versions of spring libs
```xmlorg.springframework.boot
spring-boot-starter-security
2.2.2.RELEASE```
#### 2. Map spring-security
In [here](src/main/java/io/github/nhomble/openapidemo/configuration/WebSecurityConfig.java)
##### Note: there is an in-memory user defined# Demo
1. refresh the swagger page
2. authenticate as nhomble:supersecret
3. try and fail the delete pet api, 403
4. try and succeed the get pet by id, 2xx