This repository was archived by the owner on Aug 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Mock authentication
Gustavo Denis edited this page Oct 31, 2019
·
1 revision
| Main > Using Liquid for building your application > Mock authentication |
|---|
With this method, Liquid calls the Claims-based authentication which consists of all the claims associated with an identity.
using Liquid.Microservices.Runtime;
namespace Sales.Basket.Services
{
public class OrderService : LightDomain
{
public string getToken()
{
string JWT = JwtSecurityCustom.CreateMockedToken("Jon Doe", "jondoe@mailbox.com");
return JWT;
}
Light API will consume the REST microservice
public async Task<DomainResponse> GetBasket (string hostname, string basketId)
{
Telemetry.TrackEvent("Get Basket by ID");
string JWT = getToken();
LightAPI Basket = new LightAPI(hostname, JWT, this);
BasketViewModel data = Basket.Get<BasketViewModel>($"/{basketId}");
return Response(data);
}
}
}