https://github.com/jpomykala/spring-mvc-jwt-example
The project was created to share Spring/JWT solutions among my friends
https://github.com/jpomykala/spring-mvc-jwt-example
jwt spring spring-boot spring-framework spring-mvc-jwt
Last synced: 12 months ago
JSON representation
The project was created to share Spring/JWT solutions among my friends
- Host: GitHub
- URL: https://github.com/jpomykala/spring-mvc-jwt-example
- Owner: jpomykala
- Created: 2017-01-09T14:01:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-04T15:38:49.000Z (over 5 years ago)
- Last Synced: 2025-04-06T10:12:51.536Z (about 1 year ago)
- Topics: jwt, spring, spring-boot, spring-framework, spring-mvc-jwt
- Language: Java
- Homepage: https://jpomykala.com
- Size: 119 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-mvc-jwt-example
Sample Spring MVC application using JWT tokens and Spring Security
Keep It Simple Stupid
Checkout my [website](https://jpomykala.com) or [follow me on Twitter](https://twitter.com/jakub_pomykala)
### Register new user
```
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: */*' -d '
{"email":"jakub.pomykala%40gmail.com",
"firstName":"Jakub",
"token":"egFacebookToken",
"provider":"FACEBOOK"
}'
'http://localhost:9200/auth/sign'
```
### Access to restricted endpoint by `@PreAuthorize("hasRole('ROLE_USER')")`
```
curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: */*'
--header 'Authorization: '
'http://localhost:9200/tags?name=sometag'
```
### Utils
* H2 Database console `http://localhost:9400`
* Swagger `http://localhost:9200/swagger-ui.html`
### TODO
* Tests ;)