Skip to content

Sample standalone OAuth2 authorization server using Spring Boot

Notifications You must be signed in to change notification settings

aldwindelgado/spring-boot-oauth2-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample standalone OAuth2 authorization server for Spring Boot (Uses in-memory token store)

The requesting method for token supports both json format and url-encoded format

The token validity is currently 60secs.

Update any of the clienId/clientPassword/tokenValidity to however you want.

Other implementations

Running

mvn clean package spring-boot:run

Request for a token

Use any of the curl commands to request an access token.

Using URL-Encoded Format

curl -X POST -H "Authorization: Basic YWNjb3VudDpwYXNzd29yZA=="  -H "Content-Type: application/x-www-form-urlencoded" -v localhost:8080/oauth/token?grant_type=client_credentials

Using JSON Format

curl -X POST -H "Authorization: Basic YWNjb3VudDpwYXNzd29yZA=="  -H "Content-Type: application/json" -d '{ "grant_type": "client_credentials" }' -v localhost:8080/oauth/token

Resource Server

See spring-boot-oauth2-client for running the oauth-client (resource server)

Releases

No releases published

Packages

No packages published

Languages