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
Secure the APIs
Gustavo Denis edited this page Oct 31, 2019
·
1 revision
| Main > Using Liquid for building your application > Secure the APIs |
|---|
Liquid encapsulates the activation and bypass of authentication of the interfaces of a microservice.
By simply activating the workbench, OAuth authentication takes place as previously configured.
Startup.cs
-------------------------------------------------------------------------------
public void ConfigureServices(IServiceCollection services)
{
...
services.AddWorkBench(Configuration); // This automatically activates OAuth security
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
....
app.UseWorkBench(Configuration); // This automatically activates OAuth security;
}
#Synchronous calls (via REST) Then controllers get secured in standard way.
[Authorize]
public class InvoiceController : LightController
{
...
}
| See how this is done in Liquid Hotel360 sample application. |
|---|
#Asynchronous messages (via Message Bus) And workers can also be secured.
[Authorize(Policy = "AtLeast21")]
[Queue("invoices", 1)]
public void ProcessInvoice(InvoiceMessage msg)
{
...
}
| See how this is done in Liquid Hotel360 sample application. |
|---|