asp.net-core-2.0

.Net Core 2 OpenID Connect Authentication and multiple Identities

泪湿孤枕 提交于 2021-02-13 03:51:15
问题 I'm still learning the Identity Framework and am pretty lost in trying to setup authentication in my .Net Core 2 MVC application. Any suggestions are appreciated since I'm not even sure what I'm doing is correct. I have a requirement to integrate an OpenID Connect identity provider for authentication and use a secondary data source for authorization . Inconveniently I cannot use any claim from the OIDC IdP except for the name claim. The rest of the user claims must come from the secondary

.Net Core 2 OpenID Connect Authentication and multiple Identities

 ̄綄美尐妖づ 提交于 2021-02-13 03:50:22
问题 I'm still learning the Identity Framework and am pretty lost in trying to setup authentication in my .Net Core 2 MVC application. Any suggestions are appreciated since I'm not even sure what I'm doing is correct. I have a requirement to integrate an OpenID Connect identity provider for authentication and use a secondary data source for authorization . Inconveniently I cannot use any claim from the OIDC IdP except for the name claim. The rest of the user claims must come from the secondary

.Net Core 2 OpenID Connect Authentication and multiple Identities

喜欢而已 提交于 2021-02-13 03:50:18
问题 I'm still learning the Identity Framework and am pretty lost in trying to setup authentication in my .Net Core 2 MVC application. Any suggestions are appreciated since I'm not even sure what I'm doing is correct. I have a requirement to integrate an OpenID Connect identity provider for authentication and use a secondary data source for authorization . Inconveniently I cannot use any claim from the OIDC IdP except for the name claim. The rest of the user claims must come from the secondary

Dotliquid cannot bind property of an object inside an array

▼魔方 西西 提交于 2021-02-11 12:47:30
问题 I have a .NET Core application that is using dotliquid. From the try online it looks like I can bind a property of an object that is inside an array. Like {{user.tasks[0].name}} where tasks is a collection of task object and name is property of the task . I have JSON model that would be the input to the template. I don't know the JSON structure during the design time. So I am converting JSON string into ExpandoObject . However, this does not work when I bind property of an object that is

File upload in ASP.NET Core 2 razor pages

强颜欢笑 提交于 2021-02-10 20:44:51
问题 I'm trying to do a simple file upload in asp.net core 2 razor pages. I have the code below. Please realize that it is imcomplete. When i run in my VS2017, I check my FileUpload object, and it is unfortunately null. I would hope that it is something besides null and I could create a stream to get some data out of it. However, with the object being null, I would suspect that I do not have something tied together correctly. Any thoughts are appreciated. Thanks. Code behind cs: public class

File upload in ASP.NET Core 2 razor pages

跟風遠走 提交于 2021-02-10 20:43:27
问题 I'm trying to do a simple file upload in asp.net core 2 razor pages. I have the code below. Please realize that it is imcomplete. When i run in my VS2017, I check my FileUpload object, and it is unfortunately null. I would hope that it is something besides null and I could create a stream to get some data out of it. However, with the object being null, I would suspect that I do not have something tied together correctly. Any thoughts are appreciated. Thanks. Code behind cs: public class

.NET Core Scoped called in Singleton through DI

时光怂恿深爱的人放手 提交于 2021-02-10 12:44:52
问题 I'm getting an error in 2.0 that I used not to get in .Net Core 1.1. Cannot consume scoped service 'ArithmosDaily.Data.ArithmosContext' from singleton 'ArithmosDaily.IHangfireJobSchedulerService'. I am using Hangfire, and I need it to access my database (so I inject my context through DI) to update the database with some data from an API on a schedule. So it appears the DbContext is instantiated as Scoped, and I am setting my Hangfire service as a Singleton. In Core 1.1, there was no check

.NET Core Scoped called in Singleton through DI

孤街浪徒 提交于 2021-02-10 12:42:29
问题 I'm getting an error in 2.0 that I used not to get in .Net Core 1.1. Cannot consume scoped service 'ArithmosDaily.Data.ArithmosContext' from singleton 'ArithmosDaily.IHangfireJobSchedulerService'. I am using Hangfire, and I need it to access my database (so I inject my context through DI) to update the database with some data from an API on a schedule. So it appears the DbContext is instantiated as Scoped, and I am setting my Hangfire service as a Singleton. In Core 1.1, there was no check

Bootstrap not working in Razor Pages

三世轮回 提交于 2021-02-10 05:16:06
问题 Bootstrap is working in my index page and other pages which are by default generate....But the folder i create inside pages and scaffold using crud on those pages bootstrap is not working.....I tried the same thing in asp.net core 2 mvc template and it works fine. Here is my create view @page @model Memberships.Pages.Section_Page.CreateModel @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Create</title> </head> <body> <h4>Section<

How to consume a web service using .NET Core 2.0 Connected Services

妖精的绣舞 提交于 2021-02-08 07:26:10
问题 I have created a service called GetReportService. My endpoint is http://xxx1/usa/report.asmx. I am using POST passing a parameter id123. How do I invoke this web service using a web api in .NET Core 2.0? 回答1: I figured out that the connected service option is a WCF service so I am able to consume the service as I normally would in previous versions of .NET. However, in .NET Core if I want to inject that service, I do have to go to the Startup.cs file and add my service in the