Announcements

Help Wizard

Step 1

NEXT STEP

Authorization Code Flow in Standalone App

Solved!

Authorization Code Flow in Standalone App

Plan

Premium

Country

India (IN)

Device

Lenovo ThinkPad E14 Gen 2

Operating System

Ubuntu 22.04.4 LTS

 

My Question or Issue

Is it possible to handle the entire authorization code flow within the server itself? I prefer avoiding the redirection flow because I want to shield the client from the intricacies of the authorization process.

 

In my use case, I need to transmit user-related information (which remains constant) to the client. However, the client need not concern itself with Spotify authentication or other specifics. 

 

Currently, I’m developing an app that displays the music I’m currently listening to. The front-end app will retrieve this information by calling an API, which will simply return the track ID. Despite exploring various options, I haven’t found a straightforward way to achieve this.

Reply

Accepted Solutions
Marked as solution

This one: https://community.spotify.com/t5/Spotify-for-Developers/Error-404-403-with-certain-endpoints/m-p/594...

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

View solution in original post

Marked as solution

Hi @Ximzend, I've developed my own authentication strategy wherein I store the authorization code, initially generated manually by pasting the URL and setting up a callback URL, on the server side. Later, I utilize the @spotify/spotify-web-api-ts-sdk  to extract the code from the database and complete the authentication process. This fantastic library handles token fetching and refreshing seamlessly

 

Implementation Details: status.get.ts 

View solution in original post

3 Replies

Tip: search this community. I've answered this question this week already (and in multiple other occasions).

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
Marked as solution

This one: https://community.spotify.com/t5/Spotify-for-Developers/Error-404-403-with-certain-endpoints/m-p/594...

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.
Marked as solution

Hi @Ximzend, I've developed my own authentication strategy wherein I store the authorization code, initially generated manually by pasting the URL and setting up a callback URL, on the server side. Later, I utilize the @spotify/spotify-web-api-ts-sdk  to extract the code from the database and complete the authentication process. This fantastic library handles token fetching and refreshing seamlessly

 

Implementation Details: status.get.ts 

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random