Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/ariasf/spotify-web-api-auth

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ariasf/spotify-web-api-auth

  • v0.0.0-20190608221940-74de35a3d61b
  • Source
  • Go
  • Socket score

Version published
Created
Source

spotify-web-api-auth

Using AWS lambda and Golang implement the endpoints for Spotify Athorization Code Flow for mobile apps. The main idea is to make it easier to fork this code and deploy it for your integration with spotify authorization code workflow, normally used for mobile apps.

References:

Spotify Documentation on Swap and Refresh

Using Go Gin with AWS Lambda

endpoints

Login:{{API_URL}}/spotify/login

Swap Token: {{API_URL}}/spotify/swap

Refresh Token:{{API_URL}}/spotify/refreshtoken

Start

  1. cd into /src/main

  2. go get -u github.com/golang/dep/cmd/dep

  3. dep init

  4. dep ensure

  5. We use godep for package management see dep

  6. go build main.go

  7. Make sure you do step 6 before zipping the project, otherwise the zip file won't have the latest build

zipping the exec file aws lambdas

  1. make sure to set GOHOSTARCH="amd64" and GOOS="linux" env vars
  2. cd to src/main and type chmod +x main and zip main.zip main
  3. if you are in using windows cd into src/main and type bash

AWS Set up

Create Lambda

1) create Spotify lambda

Create Spotify Lambda

2 Upload the zip file of your lambda to aws

uplod lambda zip file.PNG

3 Set env vars for lambda

set env vars for spotify.PNG

4 Create an API with AWS API Gateway

create API in AWS gateway.PNG

5 Create Spotify Resource for your API

create spotify resource.PNG

5.1 Create the other endpoints/resources with its methods

create all the other resources login swap and refresh token.PNG

5.2 create the methods of the resources using lambda proxy integration

create methods with lambda proxy integration.PNG

5.3 all endpoints and methods listed

all endpoints with all methods.PNG

6 deploy the your API

This is an important step if you do not deploy the api the endpoints won't be available outside API Gateway console

deploy API.PNG

FAQs

Package last updated on 08 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc