Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit b3595d9

Browse files
committed
Added a property (TokenTypeHint) to the options class. The property has access token as default value for backward compatibility.
1 parent 3a67512 commit b3595d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/IdentityModel.AspNetCore.OAuth2Introspection/OAuth2IntrospectionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private async Task<IntrospectionResponse> LoadClaimsForToken(string token)
144144
return await introspectionClient.SendAsync(new IntrospectionRequest
145145
{
146146
Token = token,
147-
TokenTypeHint = OidcConstants.TokenTypes.AccessToken,
147+
TokenTypeHint = Options.TokenTypeHint,
148148
ClientId = Options.ClientId,
149149
ClientSecret = Options.ClientSecret
150150
}).ConfigureAwait(false);

src/IdentityModel.AspNetCore.OAuth2Introspection/OAuth2IntrospectionOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using IdentityModel.Client;
1010
using IdentityModel.AspNetCore.OAuth2Introspection.Infrastructure;
1111
using System.Collections.Concurrent;
12+
using IdentityModel;
1213

1314
namespace Microsoft.AspNetCore.Builder
1415
{
@@ -39,6 +40,11 @@ public class OAuth2IntrospectionOptions : AuthenticationSchemeOptions
3940
/// </summary>
4041
public string ClientSecret { get; set; }
4142

43+
/// <summary>
44+
/// Specifies the token type hint of the introspection client.
45+
/// </summary>
46+
public string TokenTypeHint { get; set; } = OidcConstants.TokenTypes.AccessToken;
47+
4248
/// <summary>
4349
/// Specifies the claim type to use for the name claim (defaults to 'name')
4450
/// </summary>

0 commit comments

Comments
 (0)