commit f5266d120035646b13b580987fc17192d3b0d86f
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Wed Aug 31 15:46:50 2022 +0200
Add memory user and role store
commit 96b2e97b460ee6708b6c1792ae85c51f96b139f8
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Wed Aug 31 14:46:27 2022 +0200
Add session storage support for auth session
commit a4a52d402d371d4b8a5b6f6281059b81522316b2
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Wed Aug 31 14:22:08 2022 +0200
Implement login screen
commit 5b1e509d3f9306b9f4803de04f2d9c1c7a3fc41b
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Tue Aug 30 15:04:40 2022 +0200
Incremental work on auth
commit eccca88c07653b440f85069785416e1ce247d0d4
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Mon Aug 29 14:50:08 2022 +0200
Add couple of read wildcards for testing
commit 1b38596a34c1d56d11edc82f5b974e06ac2fde0e
Author: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Date: Mon Aug 29 14:40:49 2022 +0200
Incremental work on identity module
30 lines
1,018 B
C#
30 lines
1,018 B
C#
using System.Text;
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|
using Microsoft.IdentityModel.Tokens;
|
|
|
|
namespace Elsa.Identity.Options;
|
|
|
|
public class IdentityOptions
|
|
{
|
|
public string SigningKey { get; set; } = default!;
|
|
public string Issuer { get; set; } = "http://elsa.api";
|
|
public string Audience { get; set; } = "http://elsa.api";
|
|
public TimeSpan? Lifetime { get; set; }
|
|
|
|
public SecurityKey CreateSecurityKey() => new SymmetricSecurityKey(Encoding.ASCII.GetBytes(SigningKey));
|
|
|
|
public void ConfigureJwtBearerOptions(JwtBearerOptions options) => options.TokenValidationParameters = new TokenValidationParameters
|
|
{
|
|
IssuerSigningKey = CreateSecurityKey(),
|
|
ValidAudience = Audience,
|
|
ValidIssuer = Issuer
|
|
};
|
|
|
|
public void Deconstruct(out string signingKey, out string issuer, out string audience, out TimeSpan? lifetime)
|
|
{
|
|
signingKey = SigningKey;
|
|
issuer = Issuer;
|
|
audience = Audience;
|
|
lifetime = Lifetime;
|
|
}
|
|
} |