Examples and implementation for different OAuth flows.
This repo is just as a reference and also as a practice on how to implement different authorization flows. I'm not expert whatsoever and my implementation may have many flaws.
Please feel free to contribute to the project by pointing out mistakes, errors, corrections, better documentation, etc.
Notice that the provided examples also have minimal to none error handling.
Pre-requisites:
- Spotify APP Registered in the Developers Dashboard
- Client-ID (This is ok to be public)
- Client-Secret (This is meant to be private and used only server side) Not all flows require it
- On the Edit Settings for your App add
http://localhost:3000
andhttp://localhost:3000/api/spotify/callback
to your Redirect URIs. (Don't forget to Save and adjust the port to fit your needs) We will be using Vercel to test locally and as a deployed application. When deployed add the corresponding URIs from the App Dashboard.
- No server needed
- No recommended this days
Example in folder:
Spotify/ImplicitGrantFlow
PS: Use Authorization Code with PKCE instead.
- Server needed
Example in folder:
Spotify/AuthorizationCodeFlow
- No server needed
- Safer than Implicit Grant Flow
Example in folder:
Spotify/AuthorizationCodeFlowPKCE
Pre-requisites:
- Twitch APP Registered in the Developers Dashboard
- Client-ID (This is ok to be public)
- Client-Secret (This is meant to be private and used only server side) Not all flows require it
- On the Edit Settings for your App add
http://localhost:3000
andhttp://localhost:3000/api/twitch/callback
to your Redirect URIs. (Don't forget to Save and adjust the port to fit your needs) We will be using Vercel to test locally and as a deployed application. When deployed add the corresponding URIs from the App Dashboard.
- Server needed
Example in folder:
Twitch/AuthorizationCodeFlow