Sort Ordering Usings ...
Using ApiKey Validations and Claims Parsing from Extensions ...
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using xModels.Dtos;
|
||||
using xCommons.Constants;
|
||||
using xCommons.Providers;
|
||||
using xCommons.Extensions;
|
||||
@@ -10,6 +11,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using xIdentityModels.Constants;
|
||||
using System.Collections.Generic;
|
||||
using xIdentityService.Constants;
|
||||
using xIdentityModels.Extensions;
|
||||
using xIdentityService.Interfaces;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
@@ -82,7 +84,7 @@ namespace xIdentityService.Controllers
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +108,7 @@ namespace xIdentityService.Controllers
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -303,6 +305,66 @@ namespace xIdentityService.Controllers
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Authenticated ApiKey Person ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public XPersonDto GetApiKeyPerson()
|
||||
{
|
||||
//
|
||||
var result = User.ExtractApiKeyUser();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate and Get Authenticated ApiKey Person ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public XPersonDto ValidateAndGetApiKeyPerson()
|
||||
{
|
||||
//
|
||||
var result = User.ExtractApiKeyUser();
|
||||
if (result.IsNullOrDefault())
|
||||
{
|
||||
XException.NotAuthorized.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Authenticated JWT Person ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public XPersonDto GetAuthenticatedPerson()
|
||||
{
|
||||
//
|
||||
var result = User.ExtractAuthenticatedUser();
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate and Get Authenticated JWT Person ...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[NonAction]
|
||||
public XPersonDto ValidateAndGetAuthenticatedPerson()
|
||||
{
|
||||
//
|
||||
var result = User.ExtractAuthenticatedUser();
|
||||
if (result.IsNullOrDefault())
|
||||
{
|
||||
XException.NotAuthorized.Throw();
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user