identityserver4

User.Identity.Name is null in my ASP.NET Core Web API

荒凉一梦 提交于 2020-05-14 11:57:49
问题 I have added ASP.NET Core identity and Identity Server4 in one project with one database, and I want to use my Identity Server in all other project. IdentityServer4 Startup Class public class Startup { public IConfigurationRoot Config { get; set; } public Startup(IConfiguration configuration) { Config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", false) .Build(); Configuration = configuration; } public IConfiguration Configuration

Identity Server 4 for NodeJS API

纵饮孤独 提交于 2020-05-14 06:18:04
问题 I'm trying to figure out how to do the identity server 4 authentication below using NodeJS - way out of my comfort zone here. services.AddAuthentication(IdentityServerAuthenticationDefaults .AuthenticationScheme) .AddIdentityServerAuthentication( options => { options.Authority = "<authority-url>"; options.ApiName = "<api-url>"; }); I'm missing something in the flow here as the C# implementation isn't provided a secret or similar - so the token is probably verified via identity server? How

Identity Server 4 for NodeJS API

▼魔方 西西 提交于 2020-05-14 06:15:15
问题 I'm trying to figure out how to do the identity server 4 authentication below using NodeJS - way out of my comfort zone here. services.AddAuthentication(IdentityServerAuthenticationDefaults .AuthenticationScheme) .AddIdentityServerAuthentication( options => { options.Authority = "<authority-url>"; options.ApiName = "<api-url>"; }); I'm missing something in the flow here as the C# implementation isn't provided a secret or similar - so the token is probably verified via identity server? How

Web Api .net framework 4.6.1 and identityServer4

六月ゝ 毕业季﹏ 提交于 2020-05-13 18:13:27
问题 Web Api .net framework I have an authentication service done with IdentityServer4 .net core 1.1. The client settings are as follows: new Client { ClientId = "client", AllowedGrantTypes = GrantTypes.ClientCredentials, ClientSecrets = { new Secret("secret".Sha256()) }, AllowedScopes = { "api1" } }, // resource owner password grant client new Client { ClientId = "ro.client", AllowedGrantTypes = GrantTypes.ResourceOwnerPassword, ClientSecrets = { new Secret("secret".Sha256()) }, AllowedScopes = {

Web Api .net framework 4.6.1 and identityServer4

懵懂的女人 提交于 2020-05-13 18:12:39
问题 Web Api .net framework I have an authentication service done with IdentityServer4 .net core 1.1. The client settings are as follows: new Client { ClientId = "client", AllowedGrantTypes = GrantTypes.ClientCredentials, ClientSecrets = { new Secret("secret".Sha256()) }, AllowedScopes = { "api1" } }, // resource owner password grant client new Client { ClientId = "ro.client", AllowedGrantTypes = GrantTypes.ResourceOwnerPassword, ClientSecrets = { new Secret("secret".Sha256()) }, AllowedScopes = {

InvalidOperationException: Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()

非 Y 不嫁゛ 提交于 2020-05-13 05:24:15
问题 Summary Attempting to publish a basic .NET Core React app with auth functionality I am receiving an error with IdentityServer. This is using dotnet new react --auth Individual, .Net Core 3.0 Preview5, and following the instructions here and here. I've uploaded the PFX via the TLS/SSL settings. I've also ensured the certificate works on my dev environment, finding that GetMyX509Certificate returns the cert. The code causing the issue seems to be in Configure in Startup.cs when running app

InvalidOperationException: Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()

血红的双手。 提交于 2020-05-13 05:22:54
问题 Summary Attempting to publish a basic .NET Core React app with auth functionality I am receiving an error with IdentityServer. This is using dotnet new react --auth Individual, .Net Core 3.0 Preview5, and following the instructions here and here. I've uploaded the PFX via the TLS/SSL settings. I've also ensured the certificate works on my dev environment, finding that GetMyX509Certificate returns the cert. The code causing the issue seems to be in Configure in Startup.cs when running app

NetCore项目实战篇04---集成IdentityService4

橙三吉。 提交于 2020-05-09 16:13:54
大家都知道我们的项目中已有web api,现在可以正式访问,不论任何人只要通过输入对应的api网址就可以访问到我们的api 资源,这样是很不安全的,我们需求对当前用户进行身份验证,因此我们在项目中使用IdentityServer4来对受保护资源并实现身份验证和/或授权,直接开始上代码,这些代码直接可以在你的项目中使用,并跑起来。 1、 新建一个空的.netcore web项目,并引入IdentityService4的NuGet包。 2、 在项目中增加一个config.cs文件 public class Config { public static IEnumerable<Client> GetClients() { return new List<Client> { new Client { ClientId = " iphone " , ClientSecrets = new List<Secret> { new Secret( " secret " .Sha256()) }, RefreshTokenExpiration = TokenExpiration.Sliding, AllowOfflineAccess = true , RequireClientSecret = false , AllowedGrantTypes = new List< string >{ " sms

IdentityServer 4: No storage mechanism for grants specified - use AddInMemoryStores

血红的双手。 提交于 2020-05-09 07:39:12
问题 I am using Identity Server 4 , ASP.NET Core and trying to replace the IdentityServer developer in Production environment. But getting the following error: No storage mechanism for grants specified. Use the 'AddInMemoryStores' extension method to register a development version. So, I tried to implement the services as mentioned in this answer: IProfileService IResourceOwnerPasswordValidator This is my ConfigureServices Method in Startup class: services.AddMvc(); var identityBuilder = services

(转)CentOS 7 安装 Docker

假如想象 提交于 2020-05-05 11:37:45
原文:http://www.cnblogs.com/stulzq/p/7743073.html http://www.cnblogs.com/stulzq/p/8629165.html------------------------- ASP.NET Core & Docker 零基础持续集成 前言 首先确保你的CentOS版本为7.x 。 centos-extras 存储库必须启用。 默认情况下启用此存储库,但如果已禁用该存储库,则需要重新启用该存储库。Docker分为企业版和社区版,企业版是收费的,本文讨论的是安装社区版。 卸载旧版本 Docker的旧版本被称为 docker 或 docker-engine 。 如果安装了这些,请卸载它们以及关联的依赖关系。 sudo yum remove docker \ docker-client \ docker-client-latest \ docker- common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine 安装Docker CE(CE代表社区版) 您可以根据需要以不同的方式安装Docker CE: