C#C
C#17mo ago
Tim

Authenticate with AspNet.Security.OAuth.Spotify

I have the following code with the
AspNet.Security.OAuth.Spotify
-Package but I have no idea where the user should authenticate in the end - what is the endpoint for that?

c#
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddAuthentication().AddSpotify(options =>
{
    options.ClientId = "";
    options.ClientSecret = "";
    options.SaveTokens = true;
    options.CallbackPath = "/auth/callback";

    var scopes = new List<string>
    {
        "user-library-read",
        "playlist-read-private",
        "playlist-read-collaborative",
        "playlist-modify-private",
        "playlist-modify-public"
    };
    options.Scope.Add(String.Join(",", scopes));
});

var app = builder.Build();
app.MapRazorPages();
app.UseAuthentication();
app.UseAuthorization();

app.Run();
Was this page helpful?