openiddict

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

梦想的初衷 提交于 2021-01-28 15:47:54
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

谁都会走 提交于 2021-01-28 15:40:17
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

独自空忆成欢 提交于 2021-01-28 15:39:02
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

Exchanging a google idToken for local openId token c#

穿精又带淫゛_ 提交于 2020-01-10 11:18:30
问题 I am using this github project https://github.com/openiddict/openiddict-core which is great. But I am stuck as to what the procedures should be, or how to implement them, when the user uses an external identity provider, for this example, I will use google. I have an angular2 app running, with an aspnet core webAPI. All my local logins work perfectly, I call connect/token with a username and password, and an accessToken is returned. Now I need to implement google as an external identity

Exchanging a google idToken for local openId token c#

痞子三分冷 提交于 2020-01-10 11:17:53
问题 I am using this github project https://github.com/openiddict/openiddict-core which is great. But I am stuck as to what the procedures should be, or how to implement them, when the user uses an external identity provider, for this example, I will use google. I have an angular2 app running, with an aspnet core webAPI. All my local logins work perfectly, I call connect/token with a username and password, and an accessToken is returned. Now I need to implement google as an external identity

Social authentication in Web Api Core

那年仲夏 提交于 2020-01-04 04:39:09
问题 ASP.NET Core has integrated support for Google, Facebook and Twitter authentication. This msdn article covers it pretty well. But it seems like it works only for MVC but for Web Api you have to implement a lot of stuff on your own. Thanks to Openiddict I managed to do it for my project but it still feels like I have to write quite low-level code that should be a part of framework. It would be nice to have simple calls like app.UseGoogleAuthentication in Web Api . So my question is why they

OpenIdConnect access_token size and accessing claims server side

倖福魔咒の 提交于 2019-12-24 02:55:40
问题 I am trying to wrap my head around several concepts here but I don't want this question to be too broad - basically what we are trying to do is use role claims as permissions to lock down our API but I am finding that the access_token is becoming too big. We are using OpenIddict and ASP.NET Identity 3 on the server side. We have implemented the default AspNetRoleClaims table to store our claims for each role - using them as permissions. We lock down our API endpoints using custom policy based

AddJwtBearer OnAuthenticationFailed return custom error

本小妞迷上赌 提交于 2019-12-23 19:08:15
问题 I am using Openidict. I am trying to return custom message with custom status code, but I am unable to do it. My configuration in startup.cs : services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(o => { o.Authority = this.Configuration["Authentication:OpenIddict:Authority"]; o.Audience = "MyApp"; //Also in Auhorization.cs controller. o

How do you troubleshoot AspNet Core missing dependencies?

百般思念 提交于 2019-12-23 08:27:38
问题 So I made a change to my project.json which caused a re-restore which is coming up with a bunch of unresolvable dependencies. How do you figure out what is going on here? This was definitely working as I wrote quite a bit of code against this project.json file. "dependencies": { "EntityFramework.Commands": "7.0.0-*", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-*", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-*", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-*", "Microsoft.AspNet

.NET Core WebAPI + OpenIdDict (credentials flow) and Angular2 client: 401 after successful login (full repro)

夙愿已清 提交于 2019-12-21 04:45:07
问题 I'm trying to create an Angular2 SPA consuming a .NET Core Web API protected using OpenIdDict, with credentials flow. In creating a repro solution for this issue, I have also detailed all my steps in a readme, so hope this post can be useful to newbies like me. Please find the full repro solutions in these repositories: server-side (.NET Core + OpenIdDict), with detailed instructions to build your own: https://github.com/Myrmex/repro-oidang client-side (Angular2): https://github.com/Myrmex