1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-01 23:31:41 +01:00

web policy for two factor apis

This commit is contained in:
Kyle Spearrin 2017-06-26 09:09:30 -04:00
parent eea2ae30b4
commit 12da107c51
2 changed files with 10 additions and 1 deletions

View File

@ -15,7 +15,7 @@ using Newtonsoft.Json;
namespace Bit.Api.Controllers
{
[Route("two-factor")]
[Authorize("Application")]
[Authorize("Web")]
public class TwoFactorController : Controller
{
private readonly IUserService _userService;

View File

@ -79,6 +79,15 @@ namespace Bit.Api
policy.AddAuthenticationSchemes("Bearer2", "Bearer3");
policy.RequireAuthenticatedUser();
policy.RequireClaim(JwtClaimTypes.AuthenticationMethod, "Application");
policy.RequireClaim(JwtClaimTypes.Scope, "api");
});
config.AddPolicy("Web", policy =>
{
policy.AddAuthenticationSchemes("Bearer2", "Bearer3");
policy.RequireAuthenticatedUser();
policy.RequireClaim(JwtClaimTypes.AuthenticationMethod, "Application");
policy.RequireClaim(JwtClaimTypes.Scope, "api");
policy.RequireClaim(JwtClaimTypes.ClientId, "web");
});
});