Added userinfo endpoint usage and api now properly creates necessary claims to start doing database stuff
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
|
||||
@@ -7,10 +9,5 @@ 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().Split(" ")[1]
|
||||
: String.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user