Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOAuth2AuthorizationCodeFlow accessing Spotify
Qt 6.11 is out! See what's new in the release blog

QOAuth2AuthorizationCodeFlow accessing Spotify

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 984 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • canellasC Offline
    canellasC Offline
    canellas
    wrote on last edited by
    #1

    I am trying to make this project to work.

    I changed mainwindow.cpp:22 to use my Client Id, and mainwindow.cpp:23 to use my Client Secret, that I registered for my app at Spotify.

    But it does not matter which Redirect URI I set for my app registration, at Spotify, this example uses redirect_uri=http://localhost/:8080 in the URL. I tried to edit it to redirect_uri=https://localhost/:8080, as I (think I) read somewhere, but with no results: the browser reports INVALID_CLIENT: Invalid redirect URI.

    I also tried to insert replyHandler->setProperty("redirect_uri", "https://localhost:8080/"); after line 19.

    I also read this, this and this, but I just couldn't get it to work.

    Later, I had the idea to clear the "data of the hosted app" in the browser's cache (I dont know if that's the English name, as my browser runs in pt-br) , and the login page at last appeared!!

    I have to click 3 times on the Login button for the Gotcha to appear (click on the images with cars, etc), but nothing happens in the browser or in the app. I even created a premium account at Spotify, but it made no difference.

    Any help will be much appreciated!!

    Thanks!

    raven-worxR 1 Reply Last reply
    0
    • canellasC canellas

      I am trying to make this project to work.

      I changed mainwindow.cpp:22 to use my Client Id, and mainwindow.cpp:23 to use my Client Secret, that I registered for my app at Spotify.

      But it does not matter which Redirect URI I set for my app registration, at Spotify, this example uses redirect_uri=http://localhost/:8080 in the URL. I tried to edit it to redirect_uri=https://localhost/:8080, as I (think I) read somewhere, but with no results: the browser reports INVALID_CLIENT: Invalid redirect URI.

      I also tried to insert replyHandler->setProperty("redirect_uri", "https://localhost:8080/"); after line 19.

      I also read this, this and this, but I just couldn't get it to work.

      Later, I had the idea to clear the "data of the hosted app" in the browser's cache (I dont know if that's the English name, as my browser runs in pt-br) , and the login page at last appeared!!

      I have to click 3 times on the Login button for the Gotcha to appear (click on the images with cars, etc), but nothing happens in the browser or in the app. I even created a premium account at Spotify, but it made no difference.

      Any help will be much appreciated!!

      Thanks!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @canellas
      Are you sure you want to redirect to https://localhost:8080?? Note the https!
      If not then change it to http://localhost:8080
      If it's correct check that you have OpenSSL binaries available for your app.

      I have no idea if QOAuthHttpServerReplyHandler is capable of SSL, but this was what came to my mind first.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • canellasC Offline
        canellasC Offline
        canellas
        wrote on last edited by
        #3

        That was exactly the problem: misconfiguration between what I registered at Spotify, and what the app was using.

        Thanks a lot!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved