11// Copyright (c) Duende Software. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33
4+ using IdentityModel . Client ;
5+ using Microsoft . AspNetCore . Authentication ;
6+ using Microsoft . AspNetCore . Http ;
7+ using Microsoft . Extensions . Caching . Distributed ;
8+ using Microsoft . Extensions . Logging ;
9+ using Microsoft . Extensions . Options ;
410using System ;
511using System . Collections . Concurrent ;
612using System . Collections . Generic ;
713using System . Linq ;
814using System . Security . Claims ;
915using System . Text . Encodings . Web ;
1016using System . Threading . Tasks ;
11- using IdentityModel . Client ;
12- using Microsoft . AspNetCore . Authentication ;
13- using Microsoft . AspNetCore . Http ;
14- using Microsoft . Extensions . Caching . Distributed ;
15- using Microsoft . Extensions . Logging ;
16- using Microsoft . Extensions . Options ;
1717
1818namespace IdentityModel . AspNetCore . OAuth2Introspection
1919{
@@ -33,16 +33,14 @@ public class OAuth2IntrospectionHandler : AuthenticationHandler<OAuth2Introspect
3333 /// </summary>
3434 /// <param name="options">The options.</param>
3535 /// <param name="urlEncoder">The URL encoder.</param>
36- /// <param name="clock">The clock.</param>
3736 /// <param name="loggerFactory">The logger factory.</param>
3837 /// <param name="cache">The cache.</param>
3938 public OAuth2IntrospectionHandler (
4039 IOptionsMonitor < OAuth2IntrospectionOptions > options ,
4140 UrlEncoder urlEncoder ,
42- ISystemClock clock ,
4341 ILoggerFactory loggerFactory ,
4442 IDistributedCache cache = null )
45- : base ( options , loggerFactory , urlEncoder , clock )
43+ : base ( options , loggerFactory , urlEncoder )
4644 {
4745 _logger = loggerFactory . CreateLogger < OAuth2IntrospectionHandler > ( ) ;
4846 _cache = cache ;
@@ -154,10 +152,10 @@ await _cache.SetClaimsAsync(Options, token, claimsWithExp, Options.CacheDuration
154152 }
155153
156154 private static async Task < AuthenticateResult > ReportNonSuccessAndReturn (
157- string error ,
158- HttpContext httpContext ,
159- AuthenticationScheme scheme ,
160- OAuth2IntrospectionEvents events ,
155+ string error ,
156+ HttpContext httpContext ,
157+ AuthenticationScheme scheme ,
158+ OAuth2IntrospectionEvents events ,
161159 OAuth2IntrospectionOptions options )
162160 {
163161 var authenticationFailedContext = new AuthenticationFailedContext ( httpContext , scheme , options )
@@ -171,11 +169,11 @@ private static async Task<AuthenticateResult> ReportNonSuccessAndReturn(
171169 }
172170
173171 private static async Task < TokenIntrospectionResponse > LoadClaimsForToken (
174- string token ,
175- HttpContext context ,
176- AuthenticationScheme scheme ,
177- OAuth2IntrospectionEvents events ,
178- OAuth2IntrospectionOptions options )
172+ string token ,
173+ HttpContext context ,
174+ AuthenticationScheme scheme ,
175+ OAuth2IntrospectionEvents events ,
176+ OAuth2IntrospectionOptions options )
179177 {
180178 var introspectionClient = await options . IntrospectionClient . Value . ConfigureAwait ( false ) ;
181179 using var request = CreateTokenIntrospectionRequest ( token , context , scheme , events , options ) ;
@@ -191,10 +189,10 @@ private static async Task<TokenIntrospectionResponse> LoadClaimsForToken(
191189 }
192190
193191 private static TokenIntrospectionRequest CreateTokenIntrospectionRequest (
194- string token ,
195- HttpContext context ,
196- AuthenticationScheme scheme ,
197- OAuth2IntrospectionEvents events ,
192+ string token ,
193+ HttpContext context ,
194+ AuthenticationScheme scheme ,
195+ OAuth2IntrospectionEvents events ,
198196 OAuth2IntrospectionOptions options )
199197 {
200198 if ( options . ClientSecret == null && options . ClientAssertionExpirationTime <= DateTime . UtcNow )
@@ -231,10 +229,10 @@ private static TokenIntrospectionRequest CreateTokenIntrospectionRequest(
231229 }
232230
233231 private static async Task < AuthenticateResult > CreateTicket (
234- IEnumerable < Claim > claims ,
235- string token ,
236- HttpContext httpContext ,
237- AuthenticationScheme scheme ,
232+ IEnumerable < Claim > claims ,
233+ string token ,
234+ HttpContext httpContext ,
235+ AuthenticationScheme scheme ,
238236 OAuth2IntrospectionEvents events ,
239237 OAuth2IntrospectionOptions options )
240238 {
0 commit comments