19 lines
458 B
C#
19 lines
458 B
C#
using EonaCat.gRPC.Proto;
|
|
|
|
namespace EonaCat.gRPC.Client;
|
|
|
|
public interface ITokenProvider
|
|
{
|
|
Task<AuthenticationResponse> GetTokenAsync();
|
|
}
|
|
|
|
public class AppTokenProvider : ITokenProvider
|
|
{
|
|
private AuthenticationResponse _token;
|
|
public async Task<AuthenticationResponse> GetTokenAsync()
|
|
{
|
|
if (_token == null)
|
|
_token = new AuthenticationResponse { AccessToken = "test", ExpiresIn = 300 };
|
|
return _token;
|
|
}
|
|
} |