Merged PR 101: enabled dade school token in user access module
enabled dade school token in user access module
This commit is contained in:
commit
6d3f5dd5b8
@ -19,7 +19,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// GET request for retrieving employees.
|
/// GET request for retrieving employees.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Authorize(Roles = "admin")]
|
[Authorize(Roles = "admin")]
|
||||||
[HttpGet("employees")]
|
[HttpGet("employees")]
|
||||||
public async Task<ActionResult> GetEmployeesAsync()
|
public async Task<ActionResult> GetEmployeesAsync()
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ namespace DamageAssesment.Api.Employees.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// GET request for retrieving an employee by ID.
|
/// GET request for retrieving an employee by ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// [Authorize(Roles = "admin")]
|
[Authorize(Roles = "admin")]
|
||||||
[HttpGet("employees/{id}")]
|
[HttpGet("employees/{id}")]
|
||||||
public async Task<ActionResult> GetEmployeeByIdAsync(int id)
|
public async Task<ActionResult> GetEmployeeByIdAsync(int id)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
// }
|
// }
|
||||||
// return Unauthorized(result.ErrorMessage);
|
// return Unauthorized(result.ErrorMessage);
|
||||||
// }
|
// }
|
||||||
// [Authorize(Policy = "Dadeschools")]
|
[Authorize(Policy = "Dadeschools")]
|
||||||
[HttpPost("token/{employecode}")]
|
[HttpPost("token/{employecode}")]
|
||||||
public async Task<ActionResult> AuthenticateAsync(string employecode)
|
public async Task<ActionResult> AuthenticateAsync(string employecode)
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return Unauthorized(result.ErrorMessage);
|
return Unauthorized(result.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "Dadeschools")]
|
[Authorize(Policy = "Dadeschools")]
|
||||||
[HttpPost("refreshtoken")]
|
[HttpPost("refreshtoken")]
|
||||||
public async Task<ActionResult> RefreshTokenAsync(TokenResponse tokenResponse)
|
public async Task<ActionResult> RefreshTokenAsync(TokenResponse tokenResponse)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return Unauthorized(result.ErrorMessage);
|
return Unauthorized(result.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "DamageApp", Roles ="admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpGet("users")]
|
[HttpGet("users")]
|
||||||
public async Task<ActionResult> GetUsersAsync()
|
public async Task<ActionResult> GetUsersAsync()
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "DamageApp", Roles = "admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpGet("users/{Id}")]
|
[HttpGet("users/{Id}")]
|
||||||
public async Task<ActionResult> GetUsersAsync(int Id)
|
public async Task<ActionResult> GetUsersAsync(int Id)
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "DamageApp", Roles = "admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpGet("roles")]
|
[HttpGet("roles")]
|
||||||
public async Task<ActionResult> GetRolesAsync()
|
public async Task<ActionResult> GetRolesAsync()
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
}
|
}
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
// [Authorize(Policy = "DamageApp", Roles = "admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpPost("users")]
|
[HttpPost("users")]
|
||||||
public async Task<ActionResult> PostUserAsync(User user)
|
public async Task<ActionResult> PostUserAsync(User user)
|
||||||
{
|
{
|
||||||
@ -95,7 +95,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return BadRequest(result.ErrorMessage);
|
return BadRequest(result.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "DamageApp", Roles = "admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpPut("users/{Id}")]
|
[HttpPut("users/{Id}")]
|
||||||
public async Task<ActionResult> PutUserAsync(int Id, User user)
|
public async Task<ActionResult> PutUserAsync(int Id, User user)
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
|
|||||||
return BadRequest(result.ErrorMessage);
|
return BadRequest(result.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Authorize(Policy = "DamageApp", Roles = "admin")]
|
[Authorize(Policy = "DamageApp", Roles = "admin")]
|
||||||
[HttpDelete("users/{Id}")]
|
[HttpDelete("users/{Id}")]
|
||||||
public async Task<ActionResult> DeleteUserAsync(int Id)
|
public async Task<ActionResult> DeleteUserAsync(int Id)
|
||||||
{
|
{
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
"TokenUrl": "https://dev-graph.dadeschools.net/connect/token",
|
"TokenUrl": "https://dev-graph.dadeschools.net/connect/token",
|
||||||
"ClientId": "dmapi",
|
"ClientId": "dmapi",
|
||||||
"ClientSecret": "bfce2c8d-2064-4a02-b19d-7f1d42b16eae",
|
"ClientSecret": "bfce2c8d-2064-4a02-b19d-7f1d42b16eae",
|
||||||
"TokenClientId": "damage_assessment_postman",
|
//"TokenClientId": "damage_assessment_postman",
|
||||||
"TokenClientSecret": "e4774164-f018-44c9-b9d2-3a29fc21db3c",
|
//"TokenClientSecret": "e4774164-f018-44c9-b9d2-3a29fc21db3c",
|
||||||
"scope": "openid profile",
|
"scope": "openid profile",
|
||||||
"grant_type": "password",
|
"grant_type": "password",
|
||||||
"Name": "Dadeschools Identity Server"
|
"Name": "Dadeschools Identity Server"
|
||||||
|
Loading…
Reference in New Issue
Block a user