HullRyan / spotify-lambda

A lambda function to handle spotify authentication

Home Page:https://hullryan.github.io/spotify-lambda/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spotify Authentication Lambda

This repository contains a serverless application which handles the Spotify Authorization Flow.

Lambda

This directory contains the serverless project.

There are 2 API routes implemented:

  • GET /login
  • GET /callback

The login route is what redirects the user to the Spotify Authorization Form. Once the user has succesfully authorized the application, it will then hit the callback endpoint. The callback endpoint is hit with an access code, which is then used with the Spotify Token API to exchange it for an access token and refresh token, which are then passed back to the client.

Alternatively to passing the tokens to the client, the API could persist the tokens with the users information. Based on the use case of the application, it's up to the consumer of this lambda to handle the tokens.

Client

This directory contains a really simple react application to demonstrate the flow.

About

A lambda function to handle spotify authentication

https://hullryan.github.io/spotify-lambda/


Languages

Language:TypeScript 68.4%Language:JavaScript 12.8%Language:CSS 11.0%Language:HTML 7.7%