Reputation: 99
When I use standard ApplicationUser ( Asp.Net ) in Servicestack then JWT auth works perfectly and I get the JWT token.
Then I change ApplicationUser to:
public class ApplicationUser : IdentityUser , IRequireRefreshToken
{
//for SS refreshtokens
public string? RefreshToken { get; set; }
public DateTime? RefreshTokenExpiry { get; set; }
}
Now after recreating the DB and calling for a JWT I get the following error.
System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<Int32> Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.ExecuteUpdateAsync(System.Linq.IQueryable`1<!!0>, System.Linq.Expressions.Expression`1<System.Func`2<Microsoft.EntityFrameworkCore.Query.SetPropertyCalls`1<!!0>,Microsoft.EntityFrameworkCore.Query.SetPropertyCalls`1<!!0>>>, System.Threading.CancellationToken)'.
at ServiceStack.Auth.IdentityJwtAuthProvider`2.<>c__DisplayClass113_0.<<CreateRefreshTokenAsync>g__UpdateUser|0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at ServiceStack.Auth.IdentityJwtAuthProvider`2.<>c__DisplayClass113_0.<CreateRefreshTokenAsync>g__UpdateUser|0(DbContext dbContext)
at ServiceStack.Auth.IdentityJwtAuthProvider`2.CreateRefreshTokenAsync(TUser user, IRequest req) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack.Extensions/Auth/IdentityJwtAuthProvider.cs:line 597
at ServiceStack.Auth.IdentityJwtAuthProvider`2.CreateRefreshTokenAsync(TUser user, IRequest req) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack.Extensions/Auth/IdentityJwtAuthProvider.cs:line 597
at ServiceStack.Auth.IdentityJwtAuthProvider`2.ExecuteAsync(AuthFilterContext authContext) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack.Extensions/Auth/IdentityJwtAuthProvider.cs:line 422
at ServiceStack.Auth.AuthenticateService.PostAsync(Authenticate request) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Auth/AuthenticateService.cs:line 380
at ServiceStack.Host.ServiceRunner`1.ExecuteAsync(IRequest req, Object instance, TRequest requestDto) in /home/runner/work/ServiceStack/ServiceStack/ServiceStack/src/ServiceStack/Host/ServiceRunner.cs:line 149
The issue is not with the 2 extra fields that works perfectly, it's with IRequireRefreshToken. When I remove IRequireRefreshToken all works well otherwise there is an error.
Is this a bug or not ? Thanks in advance.
Upvotes: 1
Views: 19