public async Task PostValues() { NameValueCollection formParams = await HttpContext.GetRequestFormDataAsync(); string state = formParams["state"]; AuthorizationCodeAuth.Instances.TryGetValue(state, out SpotifyAuthServer <AuthorizationCodeResponse> authServer); AuthorizationCodeAuth auth = (AuthorizationCodeAuth)authServer; auth.ClientId = formParams["clientId"]; auth.SecretId = formParams["secretId"]; string uri = auth.GetUri(); HttpContext.Redirect(uri); }
private void SpotifyAuth() { AuthorizationCodeAuth auth = new AuthorizationCodeAuth( Secret.ClientId, Secret.ClientSecret, "http://localhost:4002", "http://localhost:4002", // See https://developer.spotify.com/documentation/general/guides/scopes/ Scope.PlaylistModifyPrivate // remove tracks from own private playlist | Scope.PlaylistModifyPublic // remove tracks from own public playlist | Scope.PlaylistReadCollaborative | Scope.PlaylistReadPrivate ); auth.AuthReceived += OnAuthReceived; auth.Start(); string url = auth.GetUri(); Debug.WriteLine("Auth: " + url); Browser browser = new Browser(url); browser.ShowDialog(); profile = spotify.GetPrivateProfile(); }
public void firstTimeLogin(Action <string> callback) { AuthorizationCodeAuth auth = getAuth(); callback(auth.GetUri()); }