我在一些文章中看到,据说OpenID Connect将取代SAML作为SSO的主要协议.我不确定openID connect如何处理与不同服务提供商的会话管理功能以及如何使用它来实现单点注销?目前,是否有支持OpenID连接的IDM服务器(开源或商用)作为SSO IDP(作为SAML2 SSO IDP的替代品)?
我对使用新的ASP.Net OpenID Connect框架有疑问,同时在身份验证管道中添加新的声明,如下面的代码所示.我不确定幕后会发生多少'魔术'.我认为我的大部分问题都集中在不了解OWIN认证中间件而不是OpenID Connect上.
Q1.我要手动设置HttpContext.Current.User和Thread.CurrentPrincipal自OwinContext.Authentication.User?
Q2.我希望能够像以前一样将对象类型添加到声明中System.IdentityModel.Claims.Claim.新System.Security.Claims.Claim类只接受字符串值?
Q3.我是否需要使用新的SessionSecurityToken包装我ClaimsPrincipal在System.Security.Claims.CurrentPrincipal序列化到一个cookie -我使用的 app.UseCookieAuthentication(new CookieAuthenticationOptions());,但现在肯定在维护期间我添加任何额外的权利要求书,做究竟是什么SecurityTokenValidated事件?
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri,
Notifications = new OpenIdConnectAuthenticationNotifications()
{
SecurityTokenValidated = (context) =>
{
// retriever caller data from the incoming principal
var UPN = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.Name).Value;
var db = new SOSBIADPEntities();
var user = …Run Code Online (Sandbox Code Playgroud) 1)将OpenID Connect身份验证集成到使用Spring Security进行身份验证的Web应用程序中的最佳方法是什么?
2)有没有办法 - 从MITREid方面或Google账户方面 - 让MITREid OpenID Connect身份验证过滤器与Google的OpenID Connect服务一起使用?
我确信这些问题的答案对于使用Spring Security OpenID模块向Google进行身份验证的任何开发人员都很有用.
我的webapp使用Spring Security的OpenID模块(<openid-login .../>)进行身份验证,将Google帐户作为身份提供商.即,用户使用他们的Google Apps或GMail电子邮件地址进行身份验证.
最近,每当用户进行身份验证时,他们都会从Google帐户收到此警告消息:
重要提示:Google帐户的OpenID2将于2015年4月20日消失.
因此,谷歌正在放弃对OpenID的支持,将于2015年4月完全关闭,并声明如果您想通过Google帐户进行身份验证,则必须切换到OpenID Connect协议.
我希望Spring Security能够内置对OpenID Connect的支持,就像它内置了对OpenID的支持一样.例如像<openid-connect-login .../>元素一样的东西.但我的搜索结果却没有得到这样的支持.
我到目前为止找到的最佳候选人是MITREid Connect.它包括一个以OIDCAuthenticationFilterOpenID Connect 命名的Spring Security身份验证过滤器.问题是,它无法与Google的OpenID Connect实施互操作.
我尝试克隆MITREid simple-web-app并将其配置为使用Google帐户进行身份验证(使用OpenID Connect).但它没有用,因为它取决于Google的OpenID Connect实现不支持的随机数.来自Google帐户的错误消息是:
此消息类型不允许使用参数:nonce
接下来,我尝试将自己的MITREid AuthRequestUrlBuilder接口实现插入到MITREid配置中.我的实现和MITREid的实现之间的唯一区别是,我并没有发送随机数.
不发送nonce使得Google的OpenID Connect实现感到满意,但MITREid在Google身份验证响应中找不到nonce时抛出异常.错误消息是:
身份验证失败:ID令牌不包含nonce声明
我在MITREID'中跟踪了MITREid异常到这些行OIDCAuthenticationFilter:
// compare the nonce to our stored claim
String nonce = idClaims.getStringClaim("nonce");
if (Strings.isNullOrEmpty(nonce)) {
logger.error("ID token did not contain …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用他们的Office 365帐户对我的站点的用户进行身份验证,因此我一直遵循使用OWIN OpenID Connect中间件添加身份验证的指导,并成功管理以验证和检索其配置文件.
我现在正在尝试获取用户的电子邮件地址(因此我可以使用他们的联系人详细信息填充他们的系统帐户),但我似乎无法收到电子邮件索赔.我尝试使用作用域发出请求openid profile email,但声明集不包含任何邮件信息.
有没有办法通过OpenID Connect端点从Azure AD获取用户的电子邮件?
当使用谷歌的OpenIDConnect认证系统,它可以指定email或profile或两者的scope参数.如果您请求email范围,则"email"和"email_verified"声明将包含在id_token作为成功OAuth2身份验证会话的一部分返回的声明中.
ID令牌的有效负载
ID令牌是包含一组名称/值对的JSON对象.这是一个示例,格式化为可读性:
{"iss":"accounts.google.com",
"at_hash":"HK6E_P6Dh8Y93mRNtsDB1Q",
"email_verified":"true",
"sub":"10769150350006150715113082367",
"azp":"1234987819200.apps.googleusercontent.com",
"email":"jsmith@example.com",
"aud":"1234987819200.apps.googleusercontent.com",
"iat":1353601026,
"exp":1353604926,
"hd":"example.com"
}
Run Code Online (Sandbox Code Playgroud)
但是,请求profile范围似乎对id_token的内容没有任何影响.为了检索配置文件信息,您必须向不同的端点发出单独的HTTP请求(使用您刚刚收到的access_token进行身份验证)以获取看起来非常相似但具有更多信息的文档:
{
"kind": "plus#personOpenIdConnect",
"gender": string,
"sub": string,
"name": string,
"given_name": string,
"family_name": string,
"profile": string,
"picture": string,
"email": string,
"email_verified": "true",
"locale": string,
"hd": string
}
Run Code Online (Sandbox Code Playgroud)
理想情况下,我更愿意获取nameid_token JWT中包含的配置文件信息(只是,实际上),而不是必须单独调用.有没有办法指定其他字段并将它们作为声明包含在id_token中?如果没有,为什么要email特别处理并返回id_token?
我在 Visual Studio 'TourManagement' 中有一个解决方案,其中包含 2 个 .Net 核心项目。一个是使用 Identity Server 4 的 IDP,第二个项目是由 IDP 项目保护的 TourManagement 的 RESTful API。我的问题是如何使用 Postman 调用 Identity Server 4 来获取令牌并通过在 postman 中从身份服务器返回的标头中传递这些令牌来调用 TourManagement Bands API?我的代码如下。
IDP项目创业班
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Marvin.IDP
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddIdentityServer()
.AddDeveloperSigningCredential()
.AddTestUsers(Config.GetUsers())
.AddInMemoryApiResources(Config.GetApiResources())
.AddInMemoryIdentityResources(Config.GetIdentityResources())
.AddInMemoryClients(Config.GetClients());
services.AddCors();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCors(c => c.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
app.UseIdentityServer();
app.UseStaticFiles();
app.UseMvcWithDefaultRoute();
}
}
} …Run Code Online (Sandbox Code Playgroud) asp.net-identity postman openid-connect asp.net-core identityserver4
由于 PKCE 现在是隐式流程上推荐的授权方法,因此我正在寻找处理代码验证器的最佳实践以及如何完成此操作的建议。在高层 PKCE 授权流程中包括:
code_verifier在客户端生成code_challenge自 (1)/authorise哪个code_challenge重定向来选择 idp 并在回调中有一个codecode(3) 中的 以及 来code_verifier交换访问令牌问题是,在步骤 3 中,在应用程序重定向到授权服务器然后 idp 之前,必须将其存储code_verifier在某处。那是在什么地方?
似乎像okta-oidc-js存储code_verifier在 sessionStorage 中的库。这不会让您遭受 XSS 攻击吗?即,如果我在应用程序进入授权流程并重定向之前将其存储code_verifier在 sessionStorage 中,那么在回调中,什么会阻止某些 rouge 扩展从codeURL 和code_verifiersessionStorage 读取?其组合可用于交换访问令牌。
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{secrets.ARN_GITHUB_ACTIONS_ROLE_UAT}}
aws-region: ${{secrets.AWS_REGION}}
Run Code Online (Sandbox Code Playgroud)
这是我收到错误的地方,并且我无权访问云路径来查看历史记录,可能有人更改了凭据或删除了角色?
xml openid amazon-web-services openid-connect github-actions
我正在尝试升级我的MVC网站以使用新的OpenID Connect标准.OWIN中间件看起来非常强大,但不幸的是只支持"form_post"响应类型.这意味着Google不兼容,因为它会在"#"后面的URL中返回所有令牌,因此它们永远不会到达服务器并且永远不会触发中间件.
我试图在中间件中自己触发响应处理程序,但这似乎根本不起作用,所以我有一个简单的javascript文件解析返回的声明并将它们发送到控制器动作进行处理.
问题是,即使我在服务器端获取它们,我也无法正确解析它们.我得到的错误看起来像这样:
IDX10500: Signature validation failed. Unable to resolve
SecurityKeyIdentifier: 'SecurityKeyIdentifier
(
IsReadOnly = False,
Count = 1,
Clause[0] = System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause
),
token: '{
"alg":"RS256",
"kid":"073a3204ec09d050f5fd26460d7ddaf4b4ec7561"
}.
{
"iss":"accounts.google.com",
"sub":"100330116539301590598",
"azp":"1061880999501-b47blhmmeprkvhcsnqmhfc7t20gvlgfl.apps.googleusercontent.com",
"nonce":"7c8c3656118e4273a397c7d58e108eb1",
"email_verified":true,
"aud":"1061880999501-b47blhmmeprkvhcsnqmhfc7t20gvlgfl.apps.googleusercontent.com",
"iat":1429556543,"exp\":1429560143
}'."
}
Run Code Online (Sandbox Code Playgroud)
我的令牌验证码遵循开发IdentityServer的优秀人员概述的示例
private async Task<IEnumerable<Claim>> ValidateIdentityTokenAsync(string idToken, string state)
{
// New Stuff
var token = new JwtSecurityToken(idToken);
var jwtHandler = new JwtSecurityTokenHandler();
byte[][] certBytes = getGoogleCertBytes();
for (int i = 0; i < certBytes.Length; i++)
{
var certificate = new X509Certificate2(certBytes[i]); …Run Code Online (Sandbox Code Playgroud) 我了解Google Play测试版功能允许我将APK分发给封闭的用户组,但我还需要能够验证使用Google登录下载后登录的用户是否也在我的应用的测试版程序中,以便确保APK不是在我不知情的情况下分发和使用的.
有没有办法检查Google登录用户是否参与了使用OpenID Connect或类似技术的beta测试?
谢谢!
openid-connect ×10
c# ×3
owin ×3
oauth-2.0 ×2
openid ×2
.net ×1
android ×1
asp.net ×1
asp.net-core ×1
auth0 ×1
beta-testing ×1
google-oauth ×1
google-play ×1
jwt ×1
pkce ×1
postman ×1
saml ×1
security ×1
xml ×1