identityserver4

SignalR using IdentityServer bearer won't receive any JWTBearerEvents from Hub

人盡茶涼 提交于 2021-01-21 10:18:15
问题 We have an api (.net core 2.2) which use IdentityServerAuthenticationDefaults.AuthenticationScheme for all the controllers which works fine. We now decide to add SignalR Hub for a conference service. The hub is working fine only if we remove the authorize attribute [Authorize(AuthenticationSchemes = IdentityServerAuthenticationDefaults.AuthenticationScheme)] We did try to handle the token in the query using the following both methods (TokenRetriever or JwrBearerEvents) : services

ASP.Net Core 3 The remote certificate is invalid on MacOs

吃可爱长大的小学妹 提交于 2021-01-20 08:54:30
问题 When I try to call an API method using identityserver4, I tried before on Windows and it is working fine only in Mac OS I faced this issue and I don´t know what is happened and how to resolve it. I can access to https://localhost:6001/.well-known/openid-configuration and I can login correctly, also I tried to run this command: dotnet dev-certs https --trust and run correctly but that is not fixing the issue. This is the error in the terminal: fail: Microsoft.AspNetCore.Authentication

ASP.Net Core 3 The remote certificate is invalid on MacOs

可紊 提交于 2021-01-20 08:54:21
问题 When I try to call an API method using identityserver4, I tried before on Windows and it is working fine only in Mac OS I faced this issue and I don´t know what is happened and how to resolve it. I can access to https://localhost:6001/.well-known/openid-configuration and I can login correctly, also I tried to run this command: dotnet dev-certs https --trust and run correctly but that is not fixing the issue. This is the error in the terminal: fail: Microsoft.AspNetCore.Authentication

【One by One系列】IdentityServer4(二)使用Client Credentials保护API资源

混江龙づ霸主 提交于 2021-01-17 16:48:57
书接上回,我们将会正式开始介绍IdentityServer4。 IdentityServer4是实现了OAuth2.0+OpenId Connect两种协议的优秀第三方库,属于.net生态中的优秀成员。可以很容易集成至ASP.NET Core,颁发token。 使用 Id4 基本步骤如下: **1.**在 Startup.Configure 方法中调用 app.UseIdentityServer(); 添加中间件,把Id4添加至http请求处理管道,这使得Id4可以为OpenID Connect和OAuth2协议描述的端点(如 /connect/token )请求提供服务。 **2.**在 Startup.ConfigureServices 中注册IdentityServer4 services.AddIdentityServer(options=> { ... }); **3.**配置Identity Server Identity资源表示提供给客户端进行用户识别的信息(声明)。声明可能包括用户名称、电子邮件地址等。 API资源表示用户可通过访问令牌访问的受保护数据或功能。API 资源的一个示例是要求授权的 Web API(或 API集合)。 用于签名的凭据(credentials) 用户可能会请求访问的Identity资源和API资源 会请求获取token的客户端

How do you add parameters to an IdentityServer LogoutRequest model?

心已入冬 提交于 2021-01-07 03:44:32
问题 I'm using the Identity oidc-client-js library and calling this.usermanager.signoutRedirect({ somedata: someObject.Id }); Then in the logout endpoint I do this with the IdentityServer interaction service var logoutRequest= await _interaction.GetLogoutContextAsync(logoutId); I would have expected the somedata to show up in the Parameters property of the LogoutRequest but it doesn't. So how do I add some extra parameters to the signout? I noticed I can return a { state: 'somedata' } but I don't

IdentityServer4 之Client Credentials走起来

你离开我真会死。 提交于 2021-01-03 12:42:23
前言 API裸奔是绝对不允许滴,之前专门针对这块分享了jwt的解决方案( WebApi接口裸奔有风险 );那如果是微服务,又怎么解决呢?每一个服务都加认证授权也可以解决问题,只是显得认证授权这块冗余,重复在搞事情;IT大佬肯定容忍不了,对于微服务架构,统一的认证授权中心那是必须的。 随着.NetCore的发布,IdentityServer4随之而出,是.Net Foundation的成员之一,专门针对.NetCore而出的认证授权框架,当前.Net圈是比较火的啦;再配上微服务认证授权的必要性,我决定以此开始入手进行微服务架构学习分享; 主要的学习分享思路为敲代码为向导,如果遇到相关理论概念,结合代码案例进行解释,不在单独针对理论知识整理相关文章(主要是担心归纳总结不好,让小伙伴疑惑,所以就想着结合应用案例解释比较容易理解)。 正文 IdentityServer4 主要的功能就是认证和授权,其他功能这里先假装不知道;主要目的就是想用其统一保护各个微服务的接口;先来理解一下认证和授权: 授权(Authorization) :在用户身份认证通过之后,授予用户访问资源的过程或是用户授予第三系统访问自己资源的过程,资源可能是个人信息、文件、数据、接口等;OAuth2是现在比较火的授权标准,对于授权流程,后续会举例说明; 在公司,假如小伙伴是领导,在出差或休假的时候,通常会通过口头、邮件

Automapper issue with identityserver4 - MissingMethodException: Method not found: '!!0 AutoMapper.IMapper.Map(System.Object)'

浪尽此生 提交于 2021-01-02 05:43:25
问题 I using last version of IdentityServer 4 Issue / Steps to reproduce the problem Creating a new blazor webassembly app I scaffolded all the Identities files and customized and custom ApiAuthorizationDbContext for blazor webassembly Install Automapper v10 and AutoMapper.Extensions.Microsoft.DependencyIn v8.0.1 when I run project, in-browser give me 500 error : AuthenticationService.js:44 GET https://localhost:5001/connect/authorize?client_id=Web.Client&redirect_uri=https%3A%2F%2Flocalhost

Automapper issue with identityserver4 - MissingMethodException: Method not found: '!!0 AutoMapper.IMapper.Map(System.Object)'

心已入冬 提交于 2021-01-02 05:42:18
问题 I using last version of IdentityServer 4 Issue / Steps to reproduce the problem Creating a new blazor webassembly app I scaffolded all the Identities files and customized and custom ApiAuthorizationDbContext for blazor webassembly Install Automapper v10 and AutoMapper.Extensions.Microsoft.DependencyIn v8.0.1 when I run project, in-browser give me 500 error : AuthenticationService.js:44 GET https://localhost:5001/connect/authorize?client_id=Web.Client&redirect_uri=https%3A%2F%2Flocalhost

Automapper issue with identityserver4 - MissingMethodException: Method not found: '!!0 AutoMapper.IMapper.Map(System.Object)'

余生颓废 提交于 2021-01-02 05:42:15
问题 I using last version of IdentityServer 4 Issue / Steps to reproduce the problem Creating a new blazor webassembly app I scaffolded all the Identities files and customized and custom ApiAuthorizationDbContext for blazor webassembly Install Automapper v10 and AutoMapper.Extensions.Microsoft.DependencyIn v8.0.1 when I run project, in-browser give me 500 error : AuthenticationService.js:44 GET https://localhost:5001/connect/authorize?client_id=Web.Client&redirect_uri=https%3A%2F%2Flocalhost

Add claims in token from web api

柔情痞子 提交于 2020-12-30 03:46:58
问题 I'm working on a project using IdentityServer4 and Identity and an API. The API is protected with IDS4. The API and IDS4 are on the same project, so I have 3 projects in my solutions: - A MVC web project that contains the IdentityServer and the API - An implementation of Identity that use MongoDB as database provider - A console application that simulate the client My client authenticate with IDS4, get the access_token and then call the api with the token. This part is working fine. Now i'm