This commit is contained in:
+13
-3
@@ -69,9 +69,19 @@ builder.Services.AddAuthentication(options => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddCors(o => o.AddDefaultPolicy(builder => {
|
List<string> allowedOrigins = new List<string>{ "https://auth.mistox.com" };
|
||||||
builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader(); // No CORS
|
if (builder.Environment.IsDevelopment()) {
|
||||||
}));
|
allowedOrigins.Add("http://localhost:5000");
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.Services.AddCors(options => {
|
||||||
|
options.AddDefaultPolicy(policy => {
|
||||||
|
policy.WithOrigins(allowedOrigins.ToArray())
|
||||||
|
.AllowAnyHeader()
|
||||||
|
.AllowAnyMethod()
|
||||||
|
.AllowCredentials();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Pages Service
|
// Pages Service
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Auth.Services {
|
|||||||
new Claim(ClaimTypes.Dns, RequestedSite),
|
new Claim(ClaimTypes.Dns, RequestedSite),
|
||||||
new Claim(ClaimTypes.IsPersistent, StayLoggedIn.ToString()),
|
new Claim(ClaimTypes.IsPersistent, StayLoggedIn.ToString()),
|
||||||
]),
|
]),
|
||||||
Expires = DateTime.UtcNow.AddDays(7),
|
Expires = DateTime.UtcNow.AddMinutes(5),
|
||||||
IssuedAt = DateTime.UtcNow,
|
IssuedAt = DateTime.UtcNow,
|
||||||
SigningCredentials = new SigningCredentials(RsaPrivateKey, SecurityAlgorithms.RsaSha256),
|
SigningCredentials = new SigningCredentials(RsaPrivateKey, SecurityAlgorithms.RsaSha256),
|
||||||
Audience = TokenAudience,
|
Audience = TokenAudience,
|
||||||
|
|||||||
Reference in New Issue
Block a user