mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2025-01-12 06:27:47 +00:00
9a6bd1b456
* Added new ASP.NET Core 3 example This should show how this API can be implemented on the backend. It's not complete yet, features like token reloading is still missing. If you want to run this, use `dotnet user-secrets init` to generate your secrets file and update it with `spotify_client_id` and `spotify_secret_id` * Fixed CLI Example The last page was never processed.
15 lines
418 B
C#
15 lines
418 B
C#
using System.Linq;
|
|
using System.Security.Claims;
|
|
|
|
namespace SpotifyAPI.Web.Examples.ASP
|
|
{
|
|
public static class ClaimsExtensions
|
|
{
|
|
public static string GetSpecificClaim(this ClaimsIdentity claimsIdentity, string claimType)
|
|
{
|
|
Claim claim = claimsIdentity.Claims.FirstOrDefault(x => x.Type == claimType);
|
|
|
|
return claim != null ? claim.Value : string.Empty;
|
|
}
|
|
}
|
|
} |