Browse Source

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

pull/1907/head
Dennis Haney 3 years ago
committed by GitHub
parent
commit
327cf8e3f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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

@ -265,9 +265,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,
@ -448,6 +450,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -551,6 +554,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -753,6 +757,7 @@ public sealed class OpenIddictClientService
return new()
{
AccessToken = context.BackchannelAccessToken!,
AccessTokenExpirationDate = context.BackchannelAccessTokenExpirationDate,
IdentityToken = context.BackchannelIdentityToken,
IdentityTokenPrincipal = context.BackchannelIdentityTokenPrincipal,
Principal = context.MergedPrincipal,
@ -846,6 +851,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