openid-connect

How are OwinContext.Request.Path and PathBase populated?

懵懂的女人 提交于 2019-12-05 17:46:52
问题 I'm writing my own OWIN middleware for OpenID Connect authorization code flow, based on other examples in the Katana Project. As part of this I have to construct a couple of URIs, eg a Redirect URI and a Return URL. Other examples in Katana do this by concatenating parts from the current request, for example in CookieAuthenticationHandler loginUri = Request.Scheme + Uri.SchemeDelimiter + Request.Host + Request.PathBase + Options.LoginPath + new QueryString(Options.ReturnUrlParameter,

Can you use OpenID Connect without obtaining OAuth credentials?

旧时模样 提交于 2019-12-05 15:35:18
In Google's OpenID Migration Guide , for transitioning from OpenID 2.0 to OpenID Connect, step 1 is that I need to obtain OAuth credentials for my application. One thing I like about "regular" OpenID is that I can allow my users to authenticate from any IDP of their choosing. Whether they use Google, Yahoo, or any other endpoint, as a developer I don't need to go through the trouble of manually obtaining OAuth credentials from each of those providers and configuring my application to support them. As providers discontinue support for traditional OpenID, is there a way for me to allow users to

How to add token validation only for protected actions in ASP.NET 5 (ASP.NET Core)

試著忘記壹切 提交于 2019-12-05 10:28:50
I have added a JWT middleware to my application: app.UseJwtBearerAuthentication(options => { options.AutomaticAuthenticate = true;} ) Now if my token does not validate (e.g. expired), I still get an error that lifetime validation did not pass. Is there a way to make the middleware validate the token only for protected resources? And if not, then how and where should I call what middleware does myself (reading the token into HttpContext.User)? P.S This is how I add protection: services.AddMvc(config => { var policy = new AuthorizationPolicyBuilder() .RequireAuthenticatedUser() .Build(); config

Should I send the id token from my SPA to my rest backend?

自作多情 提交于 2019-12-05 10:24:41
I have a SPA app which is backed by a rest api server. I use Auth0 for authentication and authorization using the implicit grant flow. All the examples I read explain that i should send the access token which I receive to the api for authorization purpose. For example : https://auth0.com/blog/why-should-use-accesstokens-to-secure-an-api On the other hand, I read that access token cannot be used as a proof for authentication: http://www.thread-safe.com/2012/01/problem-with-oauth-for-authentication.html https://oauth.net/articles/authentication/ That means, I cannot trust the sub claim on my

OIDC and PWA (add to home screen)

淺唱寂寞╮ 提交于 2019-12-05 06:22:40
Update: Basically the same issue as Standalone PWA breaks login but on iOS. If you add a web app to the home screen, Chrome on android shares the local storage with the same domain in the browser. You can test this by going to https://wilfrem.github.io/add_to_homescreen_test/ then adding to home screen and see you have the same id when opened from home screen. (I did Nexus 5x) If you do the same in iOS Safari you get a new id. (i did iPod iOS 12.1.1) The oidc-client-js library sets a session reference in local storage and then recalls that on the web app s signin callback. So if you try to log

Implementing OpenIdConnectOptions Events when using Authentication.AzureAD.UI Library

為{幸葍}努か 提交于 2019-12-05 05:41:50
I have been using a library I created from samples allowing me to authenticate a .NET core web app with Azure Active Directory and to take advantage of the various OpenIdConnectOptions events (e.g. OnTokenValidated ) to add certain claims to the principal as well as add that data to an identity-like database so that APIs can make policy-based determinations of the caller based on their token. But I would just rather use the Microsoft.AspNetCore.Authentication.AzureAD.UI NuGet package than my customized variation, I am just not sure how to reach in and access the event on the

Get id_token with Chrome Identity API

亡梦爱人 提交于 2019-12-05 05:28:25
I am developping a Google Chrome extension, to allow users to authenticate with their Google Accounts, i decided to use Chrome Identity API . To authenticate the user in my Application i need to get the ID_Token (signed token) is there a way to get OpenID Connect Token with Google Chrome Identity API ? Thanks for your help ! Piotr Sobiech This is a paste of my answer from the other thread https://stackoverflow.com/a/32548057/3065313 I've came to the same problem yesterday and since I've found a solution, I might as well share it, as it wasn't that obvious. As far as i know Google does not

IdentityServer4 Correlation Failed Error with External Provider

那年仲夏 提交于 2019-12-05 05:16:53
I am attempting to integrate Ping Federate as an external OIDC provider for my IdentityServer4 instance. When I initiate the external login flow I am getting the following error: System.Exception: Correlation failed. at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.<HandleRequestAsync>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting

Is LinkedIn OpenID Connect provider? How can it be used with AWS Cognito Federated Identity?

可紊 提交于 2019-12-05 03:10:14
The AWS Cognito documentation is very sketchy when it comes to explaining OpenID Connect providers or how to implement auth using say LinkedIn. The nearest example is of SalesForce https://aws.amazon.com/blogs/security/building-an-app-using-amazon-cognito-and-an-openid-connect-identity-provider/ These steps did not work for LinkedIn using it Javascript SDK. Not able to retrieve id_token similar to FB or Google JS SDK. AWS needs id_token to return the AWS credentials. Anyone has successfully implemented Linked with AWS Cognito? Nope. It seems Linkedin does not offer full OpenID Connect. Also

How can I set the Authority on OpenIdConnect middleware options dynamically?

ぐ巨炮叔叔 提交于 2019-12-05 00:59:14
问题 We have multiple tenants, and they use different authorities (their own, not just standard providers). While I know how to dynamically set the clientId and secret, I can't figure out how to set the authority. It is set once, during startup, and afterwards it cannot be changed (or so it seems). Since we have a lot of tenants we don't want to register all at startup, and we also don't want to require a restart when tenants are added. Any suggestions how I can go about this? I'd love to use the