Configure Spring Security SAML2 from SP metadata in YAML - spring-security-saml2

Spring Security SAML2 allows many of its settings to be configured through YAML, but I can't find a YAML equivalent to RelyingPartyRegistrations.fromMetadataLocation(). By using the Identity Provider's metadata, I don't have to manually specify the sign-on URL or the IP certificate. But I can't find a built-in way to set the metadata URL via a YAML or properties file.

Related

ASP.NET Core - AddJwtBearer - Authority URL, how does it work?

One question I’ve had recently about how the JWT middleware in asp.net core works is related to the Authority URL you can set if you want to verify tokens using an identity providers asymmetric keys (JWKS based presumably). All examples I’ve seen completely fail to explain what this authority URL should be. Some auth0 examples say it’s just your auth0 domain - but if that’s the case then how does the middleware locate the public key from this base URL? Every provider has a different convention for the endpoint where a JWKS can be found - so how does this work?
My requirement is that I need to use a home grown identity provider where the JWKS endpoint is totally different to auth0, okla, identity 4 or whatever other providers are using.
Is there some standard discovery mechanism that all these providers use that I’m not aware of? Do I need to have this same discovery mechanism in place I’m the in house identity web app for this middleware to work?
Thanks!
Generally, OpenID connects provider follows the standard and provides a discovery endpoint which includes all necessary endpoints and public key location information.
OpenID connect specification: https://openid.net/specs/openid-connect-discovery-1_0.html
Auth0 exposes OIDC discovery documents (https://YOUR_DOMAIN/.well-known/openid-configuration). These can be used to automatically configure applications.
https://auth0.com/docs/protocols/oidc/openid-connect-discovery
IdentityServer 4 allows to include extra endpoint to the discovery document. http://docs.identityserver.io/en/latest/topics/discovery.html

Does artifactory support access token exchange?

We have multiple different identity providers federated (ADFS, GitHub, OpenID) with our identity management system. It won't work for us to recreate all the identity management federations with Artifactory in order for us to distribute artifacts in a protected manner. Is there any ability for Artifactory to do a token exchange similar to AWS.Cognito that can then be used to access Artifactory programmatically?
You can Authenticate users in Artifactory using external identity providers via several common protocols (LDAP, SAML, OAuth, CROWD...) - read some examples here
You will still have to define the Authorization (permissions) in Artifactory - Which Users/Groups can Read/Write/Manage etc which Resources (Repos)
To make your life easier, check out the Artifactory Access Token page, to see if it answers your programmatically accessing of Artifactory.
Using Access Tokens you can grant scoped access to your artifactory resources without having to integrate external realm users into Artifactory.
HTH,

Generating a SAML SP metadata file that works with ASP.NET Identity 2.0 Federation authentication

I am trying to configure a web application using ASP.NET Identity 2.0 for Single-SignOn with ADFS.
To configure their ADFS, my client asked me to provide a SAML Service Provider metadata file matching the following format:
In my application, I am setting up authentication in my OWIN pipeline as so:
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions()
{
MetadataAddress = ConfigurationManager.AppSettings["SsoAdfsMetadataEndpoint"],
Wtrealm = ConfigurationManager.AppSettings["SsoWtrealm"]
});
I have 2 questions:
I can generate an X509 certificate to include in the metadata, but how can I add it to my configuration in the web app?
Where can I get the URLs for all the AssertionConsumerService bindings?
SAML2P (P is for protocol) and WS-FED are two completely different protocols. To confuse things, SAML2 tokens (or assertions in SAML2 lingo) can be carried in WS-FED protocol messages.
You won't get any SAML2P functionality out of a WS-FED middleware. You need a SAML2P middleware. The open source Kentor.AuthServices.Owin package contains such a middleware, that will automatically generate the needed metadata and that has been tested with ADFS.
Disclaimer: I'm the author of Kentor.AuthServices

Specific Identity provider for Application in ApiManager

I want to setup custom authentication flow for some applications, registered in Wso2 Api Manager. Say for some applications I want to direct them to federated IDP when they request access token using authorization code or implicit flow. As a key manager I use IdentityServer.
I know that in Identity server I can create Service provider and setup custom authentication scheme for it, e.g. using Federated Authentication. Unfortunetely this service provider can't act as a subscriber for apis in Api Manager. I found an article that describes how to override default auth scheme, but I don't what override defaults.
Is it possible to setup custom IDP only for specific applications and avoid tuning default authentication scheme for oauth flows. The reason here is that I still want to use attached userstores for most of the applications but override that behaviour only for some predefined applications.
WSO2 APIM 3.2.0 onward it supports multiple key managers support. With that, you can create an application binding to a specific key manager you register. You can register a KM from UI and by default, it supports multiple IDPs like okta,oauth0 and WSO2 IS.

What is the Microsoft Enterprise Application Blocks relationship to the ASP.NET provider model?

What is the Microsoft Enterprise Application Blocks relationship to the ASP.NET provider model? (if any)
Enterprise library have a Security Application Block.
It exposes two interfaces that you can access in your code:
An Authorization Provider interface, which exposes the single method named Authorize that takes an instance of an IPrincipal object containing details of the user's identity and roles. Depending on the way that you configure the block, the authorization can take place either through Windows® Authorization Manager (AzMan) against Active Directory, an XML file, or a database; or by using custom rules that you define and are stored as XML in the application configuration file.
A Security Cache Provider interface, which exposes methods that allow you to save and retrieve a user's identity or security context as an IIdentity instance, IPrincipal instance, or ASP.NET Profile instance. Each cached identity or security context is identified by a token (by default a GUID, though you can create and use your own implementation of the IToken interface). The block stores this information in either a database or in Isolated Storage using the Caching Application Block. You can alternatively create a custom provider for the Caching Application Block and use it to cache the information in the location and using the techniques you implement in your provider.
Then you also can reference ASP.NET 2.0 Provider Model:
http://msdn.microsoft.com/zh-cn/library/aa479030.aspx

Resources