Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:42:09+00:00 2026-06-15T18:42:09+00:00

I am trying to write an app that will interact with Last.fm API and

  • 0

I am trying to write an app that will interact with Last.fm API and I got stuck.
My problem is related to authorization. Quote from Last.fm API site:

Your application needs to open an instance of a web browser and send
the user to last.fm/api/auth with your API key and authentication
token as parameters. Use an HTTP GET request.

I know how to send GET request and how to open the browser with specified URL. But how can I implement this feature and catch with my app event when user approves or disapproves authorization in browser? Maybe I should use HTTP GET for 15 seconds and if I don’t receive username I should ask user to perform authorization again. Is this a right way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:42:11+00:00Added an answer on June 15, 2026 at 6:42 pm

    That is somewhat mean. The instructions make it seem simple, but this is actually a difficult problem, and it does not even appear that Last.fm’s own liblastfm C++ library for interacting with the service provides a solution.

    Some approaches in order of increasing difficulty include:

    • Open the default web browser to the URL and display a button for the user to click after he or she has authorized the application.

      Pros: Simple

      Cons: Poor user experience. You will need to make sure that there are clear instructions for the user to follow so that he or she is not confused. Also, a user might think that your app is broken because “they already authorized your app!”, not realizing that your app does not know this until he or she presses the button.

    • Open the default web browser to the URL, display an indefinite “Waiting for authorization from Last.fm” message, and poll the auth.getSession method API call every 15 seconds or so to see if the user has authorized your application. Perhaps also provide a “Check now” button.

      Pros: Simple and not as poor of a user experience.

      Cons: The API does not appear to provide an error code signaling that the user denied authorization. You might not know if the user ever authorized your app, and you could be waiting forever for authorization. Additionally, I do not know if there are limits on auth.getSession calls, but you may face rate limit issues.

    • Embed a web browser in your application. You would have full control over it, and setting up event handlers should be straightforward.

      Pros: No need for polling as the application receives notifications when the user submits a form.

      Cons: The user interface may be confusing to some users.

    • Register a custom URI scheme with the operating system and use Last.fm’s instructions for authorizing web applications.

      The idea is to register a URI scheme (also called application protocol; e.g. myApp://) and specify a callback URL using the custom scheme (e.g. myApp://lastFmAuthorizationCallback).

      See:

      • Registering an Application to a URI Scheme
      • how do I create my own URL protocol? (e.g. so://…)
      • How to map a custom protocol to an application on the Mac?
    • (Platform specific) Automate the web browser. The exact means of doing this depend on the web browser and platform.

      Pros: Can be seamless. Should provide an excellent user experience when done right.

      Cons: Tricky to develop and the automation might break with an upgrade of the browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to write an app that will display a list off lines from
Trying to write app for service technicians that will display open service calls within
Problem: I am trying to write an app that executes some code when the
I'm trying to write a Sinatra app that will run on a shared Passenger
I'm trying to write a basic console app that will send an email. The
I'm trying to write an Android 2.2 app that will find installed apps that
I am trying to write an app that will work online and offline using
I'm trying to write a very simple terminal app that will scan for Bluetooth
I'm trying to write a simple web app that will allow me to write
I'm trying to write an Android app that will allow a user to search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.