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

Commit 94b0ccb

Browse files
Merge pull request #31 from mikaelstrid/issue-30-make-tokentypehint-configurable
Add support for setting token type hint in the options class
2 parents 8592183 + b3595d9 commit 94b0ccb

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)