Open Closed

ObjectDisposedException upon OpenIddict access token revoke #6650


User avatar
0
devpayoff created
  • ABP Framework version: v7.4.5
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): tiered
  • Exception message and full stack trace:
  • Steps to reproduce the issue: call to /connect/revocat (consequento to invocation in Angular of method oAuthService.revokeTokenAndLogout();

Sometimes we get this error,

  • is it important?
  • when happens is the token revoked?
  • how can we avoid it?

System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'OpenIddictProDbContext'. at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed() at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() at Microsoft.EntityFrameworkCore.DbContext.get_ChangeTracker() at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.OnStateChanged(InternalEntityEntry internalEntityEntry, EntityState oldState) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges, Boolean modifyProperties) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState entityState, Boolean acceptChanges, Boolean modifyProperties, Nullable1 forceStateWhenUnknownKey, Nullable1 fallbackState) at Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry.set_State(EntityState value) at Volo.Abp.OpenIddict.EfCoreOpenIddictDbConcurrencyExceptionHandler.HandleAsync(AbpDbConcurrencyException exception) at Volo.Abp.OpenIddict.Tokens.AbpOpenIddictTokenStore.UpdateAsync(OpenIddictTokenModel token, CancellationToken cancellationToken) at OpenIddict.Core.OpenIddictTokenManager1.UpdateAsync(TToken token, CancellationToken cancellationToken) at Volo.Abp.OpenIddict.Tokens.AbpTokenManager.UpdateAsync(OpenIddictTokenModel token, CancellationToken cancellationToken) at OpenIddict.Core.OpenIddictTokenManager1.TryRevokeAsync(TToken token, CancellationToken cancellationToken)


1 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    Could you please check this if it helps you https://support.abp.io/QA/Questions/5506/Access-tokens-still-valid-after-being-revoked

    Thank you.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11