Skip to content

Commit 2637825

Browse files
Improve OnCreatingTicket test
Rather than turn off an Apple-specific option, just freeze the JWT security token handler to always treat a token as valid instead.
1 parent e47e719 commit 2637825

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

test/AspNet.Security.OAuth.Providers.Tests/OAuthTests`1.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,14 @@ public async Task OnCreatingTicket_Is_Raised_By_Handler()
142142

143143
void ConfigureServices(IServiceCollection services)
144144
{
145+
services.AddSingleton<System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler, FrozenJwtSecurityTokenHandler>();
145146
services.PostConfigureAll<TOptions>((options) =>
146147
{
147148
options.Events.OnCreatingTicket = (context) =>
148149
{
149150
onCreatingTicketEventRaised = true;
150151
return Task.CompletedTask;
151152
};
152-
153-
if (options is Apple.AppleAuthenticationOptions appleOptions)
154-
{
155-
appleOptions.ValidateTokens = false; // Apple test token has expired
156-
}
157153
});
158154
}
159155

0 commit comments

Comments
 (0)