Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Authorising Toastify fails to complete #111

Open
maxthiel opened this issue Feb 19, 2019 · 11 comments
Open

Authorising Toastify fails to complete #111

maxthiel opened this issue Feb 19, 2019 · 11 comments

Comments

@maxthiel
Copy link

EXPECTED BEHAVIOUR

After login through a browser window, you should be redirected to Toastify or Spotify without problem.

ACTUAL BEHAVIOUR

After authorising Toastify, you get redirected to an unreachable page at http://localhost/auth_redirect.html

STEPS TO REPRODUCE THE BEHAVIOUR

  • Install v1.11.1 of Toastify
  • Update Spotify to the latest release
  • Launch Spotify then Toastify
  • Follow the Login flow, Authorize Toastify
  • Observe the http://localhost/auth_redirect.html unreachable page

LOG FILE

Log:

09:31:02.900+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: ========================================================================== ::
09:31:02.937+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [Architecture] IntPtr: 64bit, Is64BitProcess: True, Is64BitOS: True        ::
09:31:02.938+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [OS] Version: 10.0.17134, Friendly Name: "Microsoft Windows 10 Enterprise" ::
09:31:02.938+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [.NET] CLR Version: 4.0.30319.42000, Framework Version: 4.7.2 or later     ::
09:31:02.938+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [Toastify] Version: 1.11.1.31247, [Spotify] Version: 1.0.99.250            ::
09:31:02.938+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: ========================================================================== ::
09:31:03.057+00:00 WARN  [Toastify.Model.ToastifyActionRegistry.GetOrAddAction, 133] (1) – Unhandled toastify action enum value: CopyTrackInfo
09:31:03.057+00:00 WARN  [Toastify.Model.ToastifyActionRegistry.GetOrAddAction, 133] (1) – Unhandled toastify action enum value: PasteTrackInfo
09:31:03.376+00:00 INFO  [Toastify.Core.Spotify.GetSpotifyPath, 286] (1) – Spotify executable found: "C:\Users\%USER%\AppData\Roaming\Spotify\Spotify.exe"
09:31:03.922+00:00 INFO  [Toastify.Core.Spotify.LaunchSpotifyAndWaitForInputIdle, 420] (6) – Launching Spotify...
09:31:04.828+00:00 INFO  [Toastify.Core.Spotify.LaunchSpotifyAndWaitForInputIdle, 446] (6) – Spotify process started with ID 828
09:31:07.459+00:00 WARN  [Toastify.Core.SpotifyWindow+<Init>d__32.MoveNext, 172] (9) – Null handle returned: can't initialize WindowTitleWatcher!
09:31:07.469+00:00 FATAL [Toastify.Core.Spotify+<SpotifyWindow_InitializationFinished>d__104.MoveNext, 833] (9) – Couldn't find Spotify's window: process has been terminated
09:31:10.177+00:00 INFO  [System.Windows.Application.OnExit, 0] (1) – Toastify terminated with exit code 0.

09:31:36.970+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: ========================================================================== ::
09:31:36.994+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [Architecture] IntPtr: 64bit, Is64BitProcess: True, Is64BitOS: True        ::
09:31:36.995+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [OS] Version: 10.0.17134, Friendly Name: "Microsoft Windows 10 Enterprise" ::
09:31:36.995+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [.NET] CLR Version: 4.0.30319.42000, Framework Version: 4.7.2 or later     ::
09:31:36.995+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: [Toastify] Version: 1.11.1.31247, [Spotify] Version: 1.1.0.237             ::
09:31:36.995+00:00 INFO  [Toastify.EntryPoint.LogSystemInfo, 144] (1) – :: ========================================================================== ::
09:31:37.078+00:00 WARN  [Toastify.Model.ToastifyActionRegistry.GetOrAddAction, 133] (1) – Unhandled toastify action enum value: CopyTrackInfo
09:31:37.079+00:00 WARN  [Toastify.Model.ToastifyActionRegistry.GetOrAddAction, 133] (1) – Unhandled toastify action enum value: PasteTrackInfo
09:31:37.343+00:00 INFO  [Toastify.Core.Spotify.GetSpotifyPath, 286] (1) – Spotify executable found: "C:\Users\%USER%\AppData\Roaming\Spotify\Spotify.exe"
09:31:53.554+00:00 WARN  [Toastify.Core.SpotifyWebAPI.LogReturnedValueIfError, 164] (18) – Couldn't get the current playback context. Returned value = {
   StatusCode: "NoContent"
}
@aleab
Copy link
Owner

aleab commented Feb 21, 2019

Hi @maxthiel.
Is the issue just the page being unreachable or is the authorization not completing successfully?
In other words, are you able to see the album arts on the toast after the login/authorization?

The /auth_redirect.html page is just a low effort confirmation page, so I can easily move that here on Github. Accessing it through the local server was the first thing that crossed my mind since I was already using it for the auth flow.

@maxthiel
Copy link
Author

Hi,

I think the auth worked, as I'm now seeing the cover in the toast, and I don't get a request for auth any more.
Not sure if it's because my :80 port might already be used by some other program, so you might have the possibility to use a custom port for the local server?

Thanks!

@aleab
Copy link
Owner

aleab commented Feb 21, 2019

Yep, I could use a custom port, but not a random one unfortunately since it needs to be registered beforehand on the Spotify's dev page.
I'm currently trying to re-design the auth flow to to be able to use a random port.

@Goro2030
Copy link

I'm still seeing this behavior. After the failure described above, everything works fine. But the credentials aren't saved, so each time I start Toastify again, Chrome is opened to authenticate my Spotify account.

@MaxwellRU
Copy link

@Goro2030 same here

@WolfganP
Copy link

WolfganP commented Jul 2, 2019

Same behavior here. Toastify seems to work anyways, so maybe is not a critical page to display.

@boomerek
Copy link

boomerek commented Aug 4, 2019

same issue here

@fragande
Copy link

fragande commented Sep 6, 2019

I'm still seeing this behavior. After the failure described above, everything works fine. But the credentials aren't saved, so each time I start Toastify again, Chrome is opened to authenticate my Spotify account.

@Goro2030 I had the same problem but I think I've been able to solve it. I observed that the Spotify WebAPI indicator was red even after approving the authentication page and that there was no spotify-token.sec file in %LocalAppData%\Toastify. After unchecking the Read-only attribute of the %LocalAppData%\Toastify folder the spotify-token.sec file is created successfully and the WebAPI indicator turns green. After this I don't get the auth request again, cover-art is displayed in the Toast and the Paused indicator is no longer persistent as before.

Hope this can help.

EDIT: Running Toastify as administrator accomplishes the same thing. A cleaner solution I guess.

EDIT2: Read-only is reapplied on reboot. Running as administrator once isn't enough either as it seems Toastify modifies spotify-token.sec each time it starts. Checking the Run this program as an administrator checkbox under the Compatibility tab of the .exe works permanently though.

@Goro2030
Copy link

Goro2030 commented Sep 8, 2019 via email

@fragande
Copy link

fragande commented Sep 10, 2019

I don't think that matters. I think that redirect is only supposed to be a local confirmation page, it doesn't actually do anything. The important thing is that the spotify-token.sec is created (or updated). Unfortunately it seems like the token still expires after some time so the Toast stops working. It will however be refreshed next time you start Toastify without requiring a new authorization.

@Goro2030
Copy link

Goro2030 commented Sep 11, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants