0

I have a rails app I am trying to reduce signup drop off on by implementing a 'sign up with spotify' flow for mobile users which does not redirect users to the spotify web page, but instead authenticates using the spotify app (should it be installed on the user's phone).

To be clear, the flow I am trying to implement is:

click 'sign up with spotify' on web -> redirect to spotify mobile app for authorization -> redirect back to web with access token

I know authenticating via the app is available to other native apps, but have only been able to find 1 instance of it being done on web, here: https://www.bandsintown.com/.

What I have tried:

  1. Triggering a GET request to https://accounts.spotify.com/authorize via the following code:
<%= form_tag(spotify_connect.class::AUTHORIZE_ENDPOINT, method: :get, class: 'spotify hidden') do %>
 <input type="hidden" name="redirect_uri" value="<%= session_spotify_url %>">
 <input type="hidden" name="client_id" value="<%= spotify_application_id %>">
 <input type="hidden" name="scope" value="<%= spotify_connect.class::SCOPES.join(' ') %>">
 <input type="hidden" name="response_type" value="<%= spotify_connect.class::RESPONSE_TYPE %>">
<% end %>

This opens the spotify log in page in browser.

  1. Manually constructing the spotify app's url: spotify://authorize?client_id=1234. This does open the spotify app correctly, but with a message saying 'Cannot open this type of link'.

Does anybody have experience of this? Any help greatly appreciated

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.