- Notifications
You must be signed in to change notification settings - Fork1
satdrasing/spring-boot-oauth2-password-flow
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Securing REST API with Spring Security OAuth2 password flow
MinimalSpring Boot sample app.
For building and running the application you need:
There are several ways to run a Spring Boot application on your local machine. One way is to execute themain method in thecom.satendra.springbootoauth2passwordflow.SpringBootOauth2PasswordFlowApplication class from your IDE.
Alternatively you can use theSpring Boot Maven plugin like so:
mvn spring-boot:run
curl -X POST -u "trusted-client:trusted-secret" -d "grant_type=password&username=satendra&password=satendra1" http://localhost:8080/oauth/token{ "access_token":"1297a472-43d1-49f8-9615-cee0e1afaa44", "token_type":"bearer", "refresh_token":"b6681620-d142-404a-9af9-0adb1c55fe8d", "expires_in":3466, "scope":"read write"}curl -X POST -u "trusted-client:trusted-secret" -d "grant_type=password&username=satendra&password=worngpassword" http://localhost:8080/oauth/token{ "error":"invalid_grant", "error_description":"Bad credentials"}curl -X POST -u "wrongclient:trusted-secret" -d "grant_type=password&username=satendra&password=satendra1" http://localhost:8080/oauth/token{ "timestamp":"2019-04-26T18:28:14.872+0000", "status":401, "error":"Unauthorized", "message":"Unauthorized", "path":"/oauth/token"}About
Securing REST API with Spring Security OAuth2 password flow
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published