An open API service indexing awesome lists of open source software.

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

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 ;)