© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
63 replies
Tim

Authenticate with AspNet.Security.OAuth.Spotify

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

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();
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();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

ASPNET Sessions
C#CC# / help
2y ago
✅ Hybrid MultiTenancy with aspnet and efcore
C#CC# / help
2y ago
AspNet.Identity with custom user data
C#CC# / help
3y ago
Spotify API
C#CC# / help
4y ago