Git Product home page Git Product logo

spotify_auth's Introduction

spotify_auth

Spotify User Authorization Flow (in Go)

See https://developer.spotify.com/documentation/general/guides/authorization-guide/ for details on User Authorization

This was written for use with the Spotify iOS-SDK but should work with minor or no changes with other setups.

Installation

  1. Set environment variables SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET and SPOTIFY_AUTH_REDIRECT_URI. Client ID, Client Secret are from your Spotify Developer account and redirect URI is specific to your app (see source code for notes).

  2. Copy/symlink your https key and cert files into the same directory (DER or PEM format seems to work)

  3. That's it. Just run it (only argument is the listening port), or put in a systemd unit to have it run detached from a terminal or use the Dockerfile editing it for your needs to build a docker image to run.

Notes

Access tokens can be generated by either swapping with an access code or using a refresh token.

This should run much faster than any other implementation I've seen and is easier to setup (if you're familiar with Go and Linux). It uses the https://github.com/julienschmidt/httprouter Go package, which I've really found to be better than the standard Go package, but it's easy enough to remove that dependecy and use the stock router or another one.

See the source code for additional information.

spotify_auth's People

Contributors

cenkbilgen avatar

Stargazers

 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.