Skip to content

hufman/Oauth2TestServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oauth2TestServer

This is a simple program that implements an Oauth2 server. It replicates the behavior of the Google Oauth2 server. It also has a REST interface to manage the client_id and client_secret parts.

Client Management

POST to /client to receive a urlencoded data blob with client_id and client_secret keys.

PUT to /client by sending a urlencoded client_id and client_secret.

DELETE to /client by sending a urlencoded client_id and client_secret.

Oauth2 Functionality

GET /auth with the normal Oauth2 parameters (client_id, redirect_uri, scope) to receive a redirect with the auth_code.

POST /token with code={auth_code}, along with client_id, client_secret, and the grant_type=authorization_code, to get an access_token. If the /auth endpoint received an access_type=offline, this will also send a refresh_token.

POST /token with refresh_token={refresh_token}, along with client_id, client_secret, and the grant_type=refresh_code, to get an access_token.

GET /validate?token={access_token}, which will return 200 if valid and 401 if not.

About

A simple test server to help with unit-testing Oauth2 clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages