alexbool / oauthd

Simple OAuth server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple OAuth Server

Installation

sudo dpkg -i oauthd_1.0.0.deb

OAuth Services

Obtain OAuth access token

curl -X POST \
    --user <client_id>:<client_secret> \
    --data "grant_type=password" \
    --data "username=<login>" \
    --data "password=<password>" \
    http://localhost:8081/oauth/token

User Management Services

Check if login is free

curl "http://localhost:8081/user/check-login-free?login=<login>"

Register new user

curl -X POST \
    --header "Content-Type: application/json;charset=UTF-8" \
    --data '{ "login" : "<login>", "password" : "<password>" }' \
    http://localhost:8081/user

Get user info

curl --header "Authorization: Bearer <your token here>" http://localhost:8081/user

Change password

curl -X PATCH \
    --header "Authorization: Bearer <your token here>" \
    --header "Content-Type: application/json;charset=UTF-8" \
    --data '{ "password" : "<new_password>" }' \
    http://localhost:8081/user

Delete user

curl -X DELETE \
    --header "Authorization: Bearer <your token here>" \
    http://localhost:8081/user

Client Management Services

Available for root user only

List all clients

curl http://localhost:8081/client

Register new client

curl -X POST \
    --header "Content-Type: application/json;charset=UTF-8" \
    --data '{ "client_id" : "<client_id>", "client_secret" : "<client_secret>" }' \
    http://localhost:8081/client

Update client

curl -X PATCH \
    --header "Content-Type: application/json;charset=UTF-8" \
    --data '{ "client_secret" : "<client_secret>" }' \
    http://localhost:8081/client/<client_id>

Delete client

curl -X DELETE \
    --user <client_id>:<client_secret> \
    http://localhost:8081/client

About

Simple OAuth server


Languages

Language:Java 100.0%