question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"The entity type'OpenIddictToken' was not found" when scope=offline_access

See original GitHub issue

Hi, I’m trying to implement refresh tokens so I updated to 1.0.0-rc-1-0724 and I copied Startup and AuthController from the refresh sample.

Everything works like before but when I add scope=offline_access it gives me “The entity type’OpenIddictToken’ was not found”.

The only thing I added is: var identity = (ClaimsIdentity)principal.Identity; identity.AddClaim(OpenIdConnectConstants.Claims.Subject, user.Id.ToString(), OpenIdConnectConstants.Destinations.AccessToken, OpenIdConnectConstants.Destinations.IdentityToken); identity.AddClaim(OpenIdConnectConstants.Claims.Email, user.Email, OpenIdConnectConstants.Destinations.AccessToken, OpenIdConnectConstants.Destinations.IdentityToken); var roles = await _userManager.GetRolesAsync(user); foreach (var role in roles) { identity.AddClaim(OpenIdConnectConstants.Claims.Role, role, OpenIdConnectConstants.Destinations.AccessToken, OpenIdConnectConstants.Destinations.IdentityToken); }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tplookercommented, Nov 5, 2017

If it helps anyone else I had to explicitly tell my DbContext in onmodelcreating to scaffold the OpenIddict objects with

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    //Scaffold in the required OpenIddict tables into the database
    modelBuilder.UseOpenIddict();
    base.OnModelCreating(modelBuilder);
}
0reactions
kevinchaletcommented, Nov 11, 2017

Closing as we haven’t heard back from the OP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenIdDict is ignoring AuthenticationProperties
I'm adding AuthenticationProperties but it seems OpenIdDict is ignoring them. public async Task<IActionResult> Token() { var request ...
Read more >
Authorization storage - OpenIddict documentation
Ad-hoc authorizations are automatically created by OpenIddict when a chain of tokens needs to be tracked for security reasons, but no explicit permanent ......
Read more >
Set up token authentication with OpenIddict in .NET 5
Learn how to set up an OpenID Connect server using OpenIddict in .NET 5.
Read more >
Setting up an Authorization Server with OpenIddict - Part III
Grant Type is the Client Credentials Flow. We specify the access token url, a client id and secret to authenticate our client. We...
Read more >
Live Coding OAuth using OpenIddict and .NET - YouTube
https://andreyka26.com/ OAuth implementation using OpenIddict and . ... Server backend impl 21:10-24:30 - Authentication is not OAuth?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found