Base solution for your next web application
Open Closed

Slow TokenAuthController/Authenticate method #11658


User avatar
0
admin@SYNTAQ created

ASPNETZERO 11.2 ASPNET Core MVC

We are seeing a very slow Authenticate method on the TokenAuthController when calling the CreateJwtClaims function from the Authenticate method. The method does complete successfully but can take up to 60 seconds to complete. Captcha is not enabled

        var accessToken = CreateAccessToken(await CreateJwtClaims(loginResult.Identity, loginResult.User,
            refreshTokenKey: refreshToken.key));

The line of code that takes a long time is in the CreateJwtClaims function

        await _userManager.AddTokenValidityKeyAsync(
            user,
            tokenValidityKey,
            expirationDate
        );

1 Answer(s)