Giter Club home page Giter Club logo

oauth's Introduction

OAuth

All examples should be checked by experts and don't imply proper implementation

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.


Spotify

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 and http://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.

Spotify Implicit Grant Flow

  • No server needed
  • No recommended this days

Example in folder: Spotify/ImplicitGrantFlow

OAuth Documentation

Spotify Documentation

PS: Use Authorization Code with PKCE instead.


Spotify Authorization Code Flow

  • Server needed

Example in folder: Spotify/AuthorizationCodeFlow

OAuth Documentation

Spotify Documentation


Spotify Authorization Code Flow PKCE

  • No server needed
  • Safer than Implicit Grant Flow

Example in folder: Spotify/AuthorizationCodeFlowPKCE

OAuth Documentation

Spotify Documentation


Spotify Authorization Code Flow PKCE (With Server) Example pending


Twitch

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 and http://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.

Twitch Authorization Code Flow

  • Server needed

Example in folder: Twitch/AuthorizationCodeFlow

OAuth Documentation

Twitch Documentation


oauth's People

Contributors

mramericanmike avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.