Code never hits AuthOnAuthReceived
See original GitHub issueHi Johnny,
been at this all day, lol as you can see from a previous issue. So I pulled your code from the example and my code never hits the AuthOnAuthReceived function which i believe it needs to to get the actual access token. The code that comes back in the query doesn’t seem to work in terms of giving me the access I need. my client id and client secret are being pulled in from AWS secrets manager without an issue. I can step through and see that they are there.
` public void AuthorizeSpotify() {
AuthorizationCodeAuth auth = new AuthorizationCodeAuth(clientId, clientSecret, "https://localhost:5001", "https://localhost:5001", Scope.Streaming | Scope.UserReadBirthdate | Scope.UserModifyPlaybackState | Scope.UserReadEmail | Scope.UserReadPrivate | Scope.UserReadPlaybackState | Scope.UserReadCurrentlyPlaying | Scope.UserReadRecentlyPlayed);
auth.AuthReceived += AuthOnAuthReceived;
auth.Start();
auth.OpenBrowser();
auth.Stop(0);
}
`
` private async void AuthOnAuthReceived(object sender, AuthorizationCode payload) {
AuthorizationCodeAuth auth = (AuthorizationCodeAuth) sender;
auth.Stop();
token = await auth.ExchangeCode(payload.Code);
spotify = new SpotifyWebAPI
{
AccessToken = token.AccessToken,
TokenType = token.TokenType
};
PrintUsefulData(spotify);
}
`
When my front end triggers the first method, here is the url string I receive back: https://localhost:5001/?code=AQACfDUpM-V9PAxMttgPZ4eTV43XjhKIdB3tihgMvLxIZnuURZeVBsjTtS_T4mOPNdgsqVmrKUFXBT4cQjipoQpfM6iKMPyw_qcDH9ZvBoiJ29tRpk4LJLhdcwfcOKVVRzni9LU6XBYhpGf9eploP5zFtYWUzZcvxr4KrxUv0cx-Qc39X6wGwK4WL8dfzpcHSWfEh7NEnlHxqdFvX8GW8q5jThThcq1KRVuJ5p2L7v1WJKJavEmA2-l7BgNdAOmqB40Fiu2MrIxCvvjwbIHJ-GEl_GrWn8k3lo506GjSb7Y6plQYo3yoszC5xpfY1H2LqNiweke2e_zIuPOdxkslhxrp_wDirKT9QrBDajZ2OBGhKKFSHL8oUfchedFT5_UYpW7pgjnDAXQ8g5eEVLq1mxjDi667skqzZCmLkP9WIt8&state=3eed7400
but it never hits the other method and i know that code ^ is unauthorized. What am i doing wrong?!
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (7 by maintainers)
Did you get it working @kneekey23 ?
My problem was that I had the NoScript extension enabled for localhost, meaning the inline script it uses to pass the token back was never executed.