mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 15:06:26 +00:00
9f6729ad60
Disabled examples for now
24 lines
493 B
C#
24 lines
493 B
C#
using System.Threading.Tasks;
|
|
|
|
namespace SpotifyAPI.Web.Http
|
|
{
|
|
public class TokenHeaderAuthenticator : IAuthenticator
|
|
{
|
|
public TokenHeaderAuthenticator(string token, string tokenType)
|
|
{
|
|
Token = token;
|
|
TokenType = tokenType;
|
|
}
|
|
|
|
public string Token { get; set; }
|
|
|
|
public string TokenType { get; set; }
|
|
|
|
public Task Apply(IRequest request)
|
|
{
|
|
request.Headers["Authorization"] = $"{TokenType} {Token}";
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
}
|