SpotifyAPI-NET: ImplicintGrantAuth - Error 404
In #283 I had some problems with converting the proper Auth Code by @JohnnyCrazy from C# into VB.NET. But I think I handled it now. This is my Code now:
Private Shared Sub WebConnect()
Dim auth As SpotifyAPI.Web.Auth.ImplictGrantAuth = New SpotifyAPI.Web.Auth.ImplictGrantAuth(clientID, "http://localhost:4002", "http://localhost:4002")
AddHandler auth.AuthReceived, AddressOf AuthOnAuthReceived
auth.Start()
auth.OpenBrowser()
Console.ReadLine()
auth.Stop(0)
End Sub
Private Shared Sub AuthOnAuthReceived(ByVal sender As Object, ByVal payload As SpotifyAPI.Web.Models.Token)
Dim api = New SpotifyAPI.Web.SpotifyWebAPI With {
.TokenType = payload.TokenType,
.AccessToken = payload.AccessToken
}
Dim profile As SpotifyAPI.Web.Models.PrivateProfile = api.GetPrivateProfile
Console.WriteLine(profile.DisplayName)
End Sub
Unfortunately, I still have problems with this Auth. I added “http://localhost:4002” to the Redirect URIs in the Spotify Developer Center already. After starting WebConnect(), my browser says “Connection Failed”. When I change the parameter from auth.Stop(0) to authStop() or authStop(1000), the opened site just tells me “404 - Not Found”.
Whats wrong with my code?
EDIT: The AuthOnAuthReceived-Event doesn’t get triggered. Why?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (3 by maintainers)
I somehow figuered out to authorize to the API. But I didn’t worked on this project for months and I am not sure if the solution is still working. As soon I am back in my city I’ll send you the code for you trying it out.