OAuth using Twitch
401 lab 09 OAuth
LAB - 09
integrate OAuth instead of managing user names and passwords internally.
Setup
.env
requirements
PORT
- 3030MONGODB_URI
SECRET
CLIENT_ID
CLIENT_SECRET
REDIRECT_URI
Running the app
npm start
ornodemon
- Endpoint:
/
- Returns message
'O-auth'
- Endpoint:
/oauth_twitch
- Returns a JSON object with the generated password and the username.
{
"user": {
"username": "omar",
"password": "xxxx"
}
}
- On Start up :
index.html
- Gets the index html page that takes you to log in
Twitch O-auth
Login
- Endpoint: anything else ..
- Returns an error 404
- Returns an Object
{
"error": "Resource Not Found"
}
Pros
- improving App performance
- reducing complexity.
- Easier service monitoring
UML
(Created with diagrams)
for more clear view