Added logout function + increased default openid config caching time

This commit is contained in:
2024-12-23 12:38:30 +01:00
parent 849ad649a8
commit 0b9766f7db
4 changed files with 8 additions and 6 deletions

View File

@@ -11,4 +11,5 @@ public interface IOpenIdAccessor {
Task<OpenIdIntrospection> InspectToken(string token);
Task<OpenIdToken> RefreshAccessToken(string refreshToken);
void SetAuthenticationCookies(OpenIdToken token);
void Logout();
}

View File

@@ -137,4 +137,9 @@ internal class OpenIdAccessor(IHttpClientFactory clientFactory, IOptions<OpenIdO
Secure = true
});
}
public void Logout() {
accessor.HttpContext!.Response.Cookies.Delete(ITokenContext.RefreshTokenType);
accessor.HttpContext!.Response.Cookies.Delete(ITokenContext.AccessTokenType);
}
}

View File

@@ -22,7 +22,7 @@ public sealed class OpenIdOptions : OptionsFromConfiguration {
Configuration = new() {
Enabled = true,
TTL = new() {
Minutes = 10
Hours = 24
}
},
Auth = new() {