JoshLmao / Spotify4Unity

🎮🎵 Add the SpotifyAPI.NET library into Unity, enabling access to the Spotify Web API, allowing for control of Spotify and accessing the world of music
https://assetstore.unity.com/packages/tools/integration/spotify4unity-ui-tools-spotify-authorization-129028
MIT License
94 stars 8 forks source link

Authorization Issue #52

Open tempostudios opened 1 year ago

tempostudios commented 1 year ago

Unity 2021.1.10f1

Followed steps in Setup and created an app in Spotify.

Clicking "Sign In" brings me to the "Allow Access" page in Chrome (or Safari), but clicking "Accept" leads me to a 403 error.

I have the same callback URI listed in Unity and on the Spotify developer app settings.

Tried several different ports with the same result.

Reese

push-pop commented 1 year ago

This is due to newer versions of macOS reserving port 5000 for something else. See here: https://stackoverflow.com/questions/70913242/access-to-localhost-was-denied-you-dont-have-authorisation-to-view-this-page-h

Easy fix is just to change the port number.

Would suggest to the package owner to use a different default port or document this somewhere.

Additionally, the server port is not actually exposed on PKCEAuthConfigView.cs which makes the port a bit of a pain to change, as it is serialized but not exposed, so changing the default value in the script actually doesn't change the serialized values already on the scene.

yusuf-begames commented 1 year ago

This is due to newer versions of macOS reserving port 5000 for something else. See here: https://stackoverflow.com/questions/70913242/access-to-localhost-was-denied-you-dont-have-authorisation-to-view-this-page-h

Easy fix is just to change the port number.

Would suggest to the package owner to use a different default port or document this somewhere.

Additionally, the server port is not actually exposed on PKCEAuthConfigView.cs which makes the port a bit of a pain to change, as it is serialized but not exposed, so changing the default value in the script actually doesn't change the serialized values already on the scene.

Thank you, it worked!

For the editor stuff, I have added this line in the AuthorizationConfigView.cs:

content = new GUIContent("Server Port", "Server Port");
_config.ServerPort = EditorGUILayout.IntField(content, _config.ServerPort);