SpotifyAPI-NET
SpotifyAPI-NET copied to clipboard
Working Auth Code?
Does anybody has an working Authorization Code for me? Doesn't matter which Auth but ImplicitGrantAuth doesn't work for me (#304 ).
I just want to have access to the spotify music informations.
Doesn't matter if the code is in C# but I would prefer VB.NET-Code because I use this in my project as well.
Greets.
private AuthorizationCodeAuth auth;
public void Authentication()
{
auth = new AuthorizationCodeAuth("CLIENTID", "CLIENTSECRET",
"http://localhost:8000", "http://localhost:8000", // Set currect port
Scope.PlaylistReadPrivate | Scope.UserLibraryRead | Scope.UserReadPrivate
| Scope.UserLibraryModify | Scope.UserFollowRead | Scope.UserFollowModify | Scope.PlaylistModifyPrivate
| Scope.PlaylistModifyPublic | Scope.UserModifyPlaybackState | Scope.UserReadPlaybackState);
auth.Start();
auth.OpenBrowser();
auth.AuthReceived += auth_OnResponseReceivedEvent;
}
public void auth_OnResponseReceivedEvent(object sender, AuthorizationCode payload)
{
AuthorizationCode authCode = payload;
Token token = auth.ExchangeCode(authCode.Code).Result;
if (auth != null)
{
spotify = new SpotifyWebAPI()
{
TokenType = token.TokenType,
AccessToken = token.AccessToken
};
}
auth.Stop();
}
Hope this helps.
Hope this helps.
It works!! Finally! Big big thank you.
But a question left. I get a window like this: Pic 1 Pic 2 Pic 3
You get this too?
May I ask you what your vb.net code looks like. I am having very large problems getting started as well. Many thanks, Bob