Added oidc service to webapi with a dumb way of authenticating incoming tokens

This commit is contained in:
2021-10-13 22:26:45 -04:00
parent cccd609233
commit 33cbb4f136
13 changed files with 120 additions and 114 deletions

View File

@@ -0,0 +1,16 @@
using System;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
namespace WebAPI.Controllers
{
public class BaseController : ControllerBase
{
protected string BearerToken =>
Request.Headers.Keys.Contains(HeaderNames.Authorization) &&
Request.Headers[HeaderNames.Authorization].Count > 0
? Request.Headers[HeaderNames.Authorization].First()
: String.Empty;
}
}