This application is a micro service for user authentication and management. It utilizes Devise as this is an industry standard and has robust community support for project longevity.
To get a local copy up and running follow these simple example steps.
- Clone the repo
git clone [email protected]:Tavern-Keeper-2308/micro_auth.git
- Gem Bundle
bundle
- Rake
rails db:{drop,create,migrate,seed}
- To run on local server, http://localhost:4000/
rails s
- Live deploy via desired method
- Run test suite
bundle exec rspec
- Signs a user up for MicroAuth, must provide a valid email and password greater than 5 characters.
{
"email": "[email protected]",
"password": "123456"
}
{
"token": "Y9XDYyF1CTTssa9GE14Uu5JTpvYzzk9Uajr98y6czjANemsCcxvi2oVDfrny",
"refresh_token": "LFYxfHNU5VB1pgizMTPeJ4yndwyyNigFE1WCtukmoB_L5wgoH1cz9JmQ5Kj5",
"expires_in": 3600,
"token_type": "Bearer",
"resource_owner": {
"id": 1,
"email": "[email protected]",
"created_at": "2024-02-28T20:46:37.866Z",
"updated_at": "2024-02-28T20:46:37.866Z"
}
}
- Signs a user in to MicroAuth, generating a token and a refresh token. Must provide an email and password for a signed up user.
{
"email": "[email protected]",
"password": "123456"
}
{
"token": "We3HAeRHpwvrBPJgY2f8FrejiirtaYpAyZrboVgy9sn1PKieBRt_z6xz-bhb",
"refresh_token": "yxPPyb6-qA4odLHgUF4rxT1xrSoEuJ91sWSosv_UzaKWgfp8Ch7ze96cxAHk",
"expires_in": 3600,
"token_type": "Bearer",
"resource_owner": {
"id": 1,
"email": "[email protected]",
"created_at": "2024-02-28T20:46:37.866Z",
"updated_at": "2024-02-28T20:46:37.866Z"
}
}
- Generates a new token for a user. Must provide refresh token as bearer token, without a body.
- Used for keeping a user logged in securely without having to provide login credentials when a token expires.
{
"token": "Jf6YUxLzxnm4_gv2zcwyWV8vpwAcxSfTuSFQJsLywTxf_JZ7LHci_vxVKZCC",
"refresh_token": "kqJByMxiiMrnzSiXDsmK4GsSK2zGcdzdQmGSRSXbDoudmwzWUL5HbqWtwzLC",
"expires_in": 3600,
"token_type": "Bearer",
"resource_owner": {
"id": 1,
"email": "[email protected]",
"created_at": "2024-02-28T20:46:37.866Z",
"updated_at": "2024-02-28T20:46:37.866Z"
}
}
- Revokes an active user's token and refresh token. Must provide either token or refresh token as a bearer token. Used for logging a user out.
- Successful requests will not return a response.
- Returns info for a user. Must provide token as bearer token, without a body.
{
"id": 1,
"email": "[email protected]",
"created_at": "2024-02-28T20:46:37.866Z",
"updated_at": "2024-02-28T20:46:37.866Z"
}
Organization: Tavern Keeper
Organization Link: https://github.com/Tavern-Keeper-2308
Project Link: https://github.com/Tavern-Keeper-2308/micro_auth
Xander Hendry
Kevin Zolman