【问题标题】:SpotifyAPI-NET add scope console application c#SpotifyAPI-NET 添加范围控制台应用程序 c#
【发布时间】:2020-04-28 12:23:55
【问题描述】:

我正在使用这个库

https://github.com/JohnnyCrazy/SpotifyAPI-NET

在控制台应用程序中为了验证自己,然后创建一个播放列表

public async Task CreatePlaylist(string playlistName)
{
    CredentialsAuth auth = new CredentialsAuth(_clientId, _clientSecret);
    Token token = await auth.GetToken();

    SpotifyWebAPI api = new SpotifyWebAPI()
    {
        TokenType = token.TokenType,
        AccessToken = token.AccessToken
    };

    FullPlaylist playlist = api.CreatePlaylist(_userId, "This is my new Playlist");
    if (!playlist.HasError())
        Console.WriteLine("Playlist-URI: " + playlist.Uri);
}

我收到此错误:403 - 此请求需要用户身份验证

我知道我必须将 scope playlist-modify-public 添加到我的请求中,但我不明白该怎么做

你能帮帮我吗?

谢谢

【问题讨论】:

    标签: c# .net console-application spotify


    【解决方案1】:

    您必须在该范围内使用身份验证,对于此库,有 AuthorizationCodeAuthImplicitGrantAuth 这两种身份验证类型您可能需要,因为它们为用户提供身份验证以创建播放列表。我没有使用过这个特定的库,但你可以在SpotifyAPI.Web.Auth找到详细信息

    完全披露我确实有自己的独立于这个的 Spotify 库

    【讨论】:

      猜你喜欢
      • 2017-01-15
      • 1970-01-01
      • 2021-05-10
      • 2017-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多