added new endpoint to generate dade school token

This commit is contained in:
Vijay Uppu
2023-11-13 15:13:25 -05:00
parent 3b07723ebe
commit 9c97f08289
5 changed files with 59 additions and 2 deletions

View File

@ -14,6 +14,16 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
{
this.userAccessProvider = userAccessProvider;
}
[HttpPost("dadeschooltoken")]
public async Task<ActionResult> DadeSchoolAuthenticateAsync(string username, string password)
{
var result = await userAccessProvider.DadeSchoolAuthenticateAsync(username, password);
if (result.IsSuccess)
{
return Ok(result.TokenResponse);
}
return Unauthorized(result.ErrorMessage);
}
[Authorize(Policy = "Dadeschools")]
[HttpPost("token/{employecode}")]
public async Task<ActionResult> AuthenticateAsync(string employecode)