Browse Source

Update the client authentication results to expose the access token expiration date

pull/1916/head
Dennis Haney 2 years ago
committed by Kévin Chalet
parent
commit
1b48d96910
  1. 30
      src/OpenIddict.Client/OpenIddictClientModels.cs
  2. 6
      src/OpenIddict.Client/OpenIddictClientService.cs

30
src/OpenIddict.Client/OpenIddictClientModels.cs

@ -66,6 +66,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string? BackchannelAccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the backchannel access token, if available.
/// </summary>
public required DateTimeOffset? BackchannelAccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the backchannel identity token, if available.
/// </summary>
@ -82,6 +87,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string? FrontchannelAccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the frontchannel access token, if available.
/// </summary>
public required DateTimeOffset? FrontchannelAccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the frontchannel identity token, if available.
/// </summary>
@ -253,6 +263,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string AccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the access token, if available.
/// </summary>
public required DateTimeOffset? AccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the identity token, if available.
/// </summary>
@ -394,6 +409,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string AccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the access token, if available.
/// </summary>
public required DateTimeOffset? AccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the identity token, if available.
/// </summary>
@ -605,6 +625,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string AccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the access token, if available.
/// </summary>
public required DateTimeOffset? AccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the identity token, if available.
/// </summary>
@ -714,6 +739,11 @@ public static class OpenIddictClientModels
/// </summary>
public required string AccessToken { get; init; }
/// <summary>
/// Gets or sets the expiration date of the access token, if available.
/// </summary>
public required DateTimeOffset? AccessTokenExpirationDate { get; init; }
/// <summary>
/// Gets or sets the identity token, if available.
/// </summary>

6
src/OpenIddict.Client/OpenIddictClientService.cs

@ -343,9 +343,11 @@ public sealed class OpenIddictClientService
AuthorizationCode = context.AuthorizationCode,
AuthorizationResponse = context.Request is not null ? new(context.Request.GetParameters()) : new(),
BackchannelAccessToken = context.BackchannelAccessToken,
BackchannelAccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
BackchannelIdentityToken = context.BackchannelIdentityToken,
BackchannelIdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
FrontchannelAccessToken = context.FrontchannelAccessToken,
FrontchannelAccessTokenExpirationDate = context.FrontchannelAccessTokenExpirationDate,
FrontchannelIdentityToken = context.FrontchannelIdentityToken,
FrontchannelIdentityTokenPrincipal = context.FrontchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -590,6 +592,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -763,6 +766,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -1107,6 +1111,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -1268,6 +1273,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,

Loading…
Cancel
Save