mirror of
https://github.com/bitwarden/server.git
synced 2025-05-29 15:24:51 -05:00
AllowAll cors option for identity server
This commit is contained in:
parent
7112496ff4
commit
79ea8fef37
13
src/Api/IdentityServer/AllowAllCorsPolicyService.cs
Normal file
13
src/Api/IdentityServer/AllowAllCorsPolicyService.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using IdentityServer4.Services;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Bit.Api.IdentityServer
|
||||||
|
{
|
||||||
|
public class AllowAllCorsPolicyService : ICorsPolicyService
|
||||||
|
{
|
||||||
|
public Task<bool> IsOriginAllowedAsync(string origin)
|
||||||
|
{
|
||||||
|
return Task.FromResult(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -103,6 +103,7 @@ namespace Bit.Api
|
|||||||
})
|
})
|
||||||
.AddInMemoryApiResources(ApiResources.GetApiResources())
|
.AddInMemoryApiResources(ApiResources.GetApiResources())
|
||||||
.AddInMemoryClients(Clients.GetClients());
|
.AddInMemoryClients(Clients.GetClients());
|
||||||
|
services.AddTransient<ICorsPolicyService, AllowAllCorsPolicyService>();
|
||||||
|
|
||||||
if(Environment.IsProduction())
|
if(Environment.IsProduction())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user