AADSTS7000112 微软登录报错[TOC]
在使用Identity Server 4 以微软账户登录时,最开始是没问题的几个月后报错:Sorry, but we're having trouble signing you in. AADSTS7000112: Application '4844d50c-c84a-4aec-b756-xxxx'(Office 365 Exchange Online) is disabled.安装Azure AD
安装
以管理员的身份打...
2021-10-19
浏览(12552)
.net core 3.1 Identity Server4 (ProfileService检测有效用户与获取Claims)[TOC]
目录https://www.tnblog.net/hb/article/details/5458
关于IProfileService接口
将用户所需的所有可能的声明放入cookie中是不切实际的,因此IdentityServer定义了一个扩展点(IProfileService),以允许根据用户的需要动态...
2021-02-20
浏览(9300)
.net core 3.1 Identity Server4 (NSwag Api授权)[TOC]
创建ApiDemo3接口项目
引入NSwag库Install-Package NSwag.AspNetCore -Version 13.10.1
修改接口项目
先修改launchSettings.json的地址
{
"profiles": {
"ApIDemo2": {
"commandName": "Projec...
2021-01-26
浏览(7367)
.net core 3.1 Identity Server4 (Swagger UI授权)[TOC]
Identity Server 4的目录:https://www.tnblog.net/hb/article/details/5458项目地址:https://gitee.com/zuxiazijiahebo/IdentityServer4
前言
Swagger是一个有用的工具,用于使用标准JSON格式即时创建基本的API文档,该文档可以使用对开发人员友...
2021-01-25
浏览(9749)
.net core 3.1 Identity Server4 (实现Microsoft登录)[TOC]
创建授权应用
我们先到Azure中注册应用:https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Overview
在 “ 重定向 URI” 下,输入追加的开发 URL/signin-microsoft 。 例如 https://localhost:7200/signin-micros...
2021-01-20
浏览(7731)
.net core 3.1 Identity Server4 (实现VisualStudio登录)[TOC]授权相关应用
首先去这上面注册相关应用授权:https://app.vsaex.visualstudio.com/app/register ,操作如下
添加相关内容
添加AspNet.Security.OAuth.VisualStudio的依赖包
Install-Package AspNet.Security.OAuth.VisualStudio -Ve...
2021-01-19
浏览(6056)
.net core 3.1 Identity Server4 (实现GitHub登录)[TOC]
创建GitHub应用
在下面进行身份授权的时候,我去掉了Webhook添加了邮箱的读取。
添加相关代码
添加相关依赖库
Install-Package AspNet.Security.OAuth.GitHub -Version 3.1.6
在Startup中,添加Github相关扩展
services.AddAuthe...
2021-01-19
浏览(8467)
.net core 3.1 Identity Server4 (自定义模式)[TOC]
IdentityServer4除了提供常规的几种授权模式外(AuthorizationCode、ClientCredentials、Password、RefreshToken、DeviceCode),还提供了可以拓展的授权模式,下面就根据源码简单说下IdentityServer4是如何实现自定义授权模式的。
创建CustomAuthCo...
2021-01-18
浏览(7610)
.net core 3.1 Identity Server4 (添加同意范围页)[TOC]
在授权请求期间,如果身份服务器需要用户同意,浏览器将被重定向到同意页面。也就是说,确认也算是IdentityServer中的一个动作。确认这个词直接翻译过来有一些古怪,既然大家都知道Consent就是确认的意思,下文都以Consent来指代确认。Consent被用...
2021-01-13
浏览(7017)
前言本文主要是对 Identity Server 4 做一个整理,相关GitHub:https://gitee.com/zuxiazijiahebo/IdentityServer4ClientCredentials模式Ocelot 与 Identity Server4 鉴权 Password模式 Code模式 Implicit模式 Hybrid模式 EntityFramework Core 配置添加HTTPS证书添加同意范围页自定义模式实现GitHub登录实现Visual...
2021-01-07
浏览(7702)
.net core 3.1 Identity Server4 (添加HTTPS证书)[TOC]
通过Powershell生成X509Certificate2证书
首先找到IdentityServer4授权服务器的工作目录下,并打开Powershell脚本执行如下命令
# 创建自签名证书
$cert = New-SelfSignedCertificate -Subject "CN=证书名称" -CertStoreLocation cert:\Cu...
2021-01-07
浏览(9405)
.net core 3.1 Identity Server4 (EntityFramework Core 配置)[TOC]
在以前的时候我们所使用的数据库都是内存数据库config.UseInMemoryDatabase("Memory");,这样做的目的是为了方便测试,今天我们将IdentityServer4种的配置放到Sqlserver数据库中。
安装相关依赖包dotnet add package IdentityServer4.Ent...
2021-01-04
浏览(8482)
.net core 3.1 Identity Server4 (Hybrid模式)[TOC]
Hybrid 模式的理解
Hybrid 模式相当于(Code模式+Impact模式),所以它又被称之为混合模式。大家可以看一下下面这张图。
我们可以发现它的类型response_type既可以为,code id_token,又可以code token,还可以code id_token token。虽然这很多样,接...
2020-12-25
浏览(8152)
.net core 3.1 Identity Server4 (Implicit模式)[TOC]
Implicit 模式的理解
A.用户通过浏览器访问客户端,然后客户端跳转到授权服务器上。B.用户输入用户和密码(授权信息)C.当用户输入的用户和密码有效的话,将跳转回指定的页面(这里根据客户端传过去Url做返回),并且带有Access Token。D.跳入指...
2020-12-18
浏览(7463)
.net core 3.1 Identity Server4 (Code模式)[TOC]
Code 模式的理解
大致说一下,这种授权模式的意义。A. 用户通过浏览器在页面上请求客户端需要授权的页面时,会自动跳转到授权服务器上去登录(这里授权服务器会去验证客户端信息)B. 然后用户在授权服务器上的登录页面进行登录,登录成功后会返回一...
2020-12-15
浏览(7157)
.net core 3.1 Identity Server4 (Password模式)[TOC]
Password 模式的理解
当应用程序将用户的用户名和密码交换为访问令牌时,将使用密码授予。这就是OAuth最初创建时要防止的事情,因此,您绝对不应允许第三方应用程序使用此授权。一般这种授予类型的常见用法是为服务自己的应用启用密码登录。用户使...
2020-12-14
浏览(7135)
目录与前言目录链接:.net core Ocelot 简单网关集群熔断架构整合目录.net core 3.1 Identity Server4 (ClientCredentials模式)通过参考上面的连接达成Ocelot与IdentityServer4的 ClientCredentials进行合并,实现鉴权功能添加 AiDaSi.OcDemo.Authenzation 项目到解决方案中1.AiDaSi.OcDemo.Authenzation项目结构如...
2020-12-11
浏览(10212)
.net core 3.1 Identity Server4 (ClientCredentials模式)[TOC]
ClientCredentials 模式的理解
在这之前我先问大家一个小问题:倘若你要请假,请问你会怎么做?我想很多人都会想到走流程。如果你是一名学生,你得找老师开一张请假条,然后大门保安检验请假条有效过后才会放你走。如果你是一名工作者,...
2020-12-07
浏览(7548)
;