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:
parent
eea2ae30b4
commit
12da107c51
@ -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;
|
||||
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user