Add other parameters to saml2 authentication requets - itfoxtec-identity-saml2

I try to authenticate with itfoxtec-identity-saml2 to my IDP.At first, I used asp.net webform but I need to migrate my website to asp net core mvc and i don't know how to proceed to enter theses parameters :
authentication level
Assertion consumer URL
Endpoint
And my IDP provides me a certificate to decode SAML response.
I'm very newbie with MVC.
Help would be appreciated.
Regards
I tried to use that procedure: https://developer.okta.com/blog/2020/10/23/how-to-authenticate-with-saml-in-aspnet-core-and-csharp, but there's missing parameters

You can start by cloning/downloading the git repository https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2
And then run two of the samples:
the IdP emulator test/TestIdPCore
and the ASP.NET Core MVC RP sample test/TestWebAppCore

Related

Blazor Server Side - SAML2 Authentication

Good Day Everyone
Our Global Company is using SAML2 for our Single Sign-On Authentication (We don't use any other external authentication like Facebook, Google and Twitter), we are successfully created a SAML2 on our ASP.NET Webforms and MVC, but haven't done it on ASP.NET Core (MVC and Blazor), I search on the internet and found this:
https://developer.okta.com/blog/2020/10/23/how-to-authenticate-with-saml-in-aspnet-core-and-csharp
I haven't applied it on my ASP.NET Core MVC project, but my team want's me to use SAML2 to my Blazor Server Application project, but when I tried to create a cookie authentication on Blazor, It seems that the authentication approach of the Core MVC and Blazor Server Side is different to each other, and I think on the link above will might not work to my Blazor App, what do you think? Does someone here has successfully created Blazor Side Application that has a SAML2 Authentication?
I hope someone can help me on this and guide me.
Thanks and regards
sorry for the late response and thanks for your suggestions, but I solved this by creating an ASP.NET Core MVC and then add the Blazor Components on it, and then using the ITfoxtec SAML 2.0, I was in a tight schedule so I chose this approach, and we are not currently using Azure, I will try your solutions if I have new project
Thanks everyone.

How do I implement SAML in my application

I am using a SaaS application and I want to use our own LDAP to Login to that 3rd party application. I want to provide a link to that application in my Portal. Both the applications are hosted in Cloud and are Spring based.
Please let me know where to Start and how to go about implementing SP initiated SAML.
Thanks!
First of all you need a SAML IDP that authenticates against LDAP e.g. shibboleth.
Then you need a client side SAML stack.
Refer: SAML : SAML connectivity / toolkit.
You could also look at IDaaS e.g. Auth0 or Okta.

Spring Security Saml SSO integration not working and receiving the following InResponseToField of the Response doesn't correspond to sent message

I'm currently working on an application with AngularJS, Spring MVC, Spring Security and SAML 2.0 Extension. I’m new to Spring Security SAML and I’ve ran into multiple issues and this is the latest one.
InResponseToField of the Response doesn't correspond to sent message a1f4a0e24c8a49a99f1h9df73e95c2
All of my saml configuration files are available here
https://github.com/MatthewLangford/samlConfig/tree/master
I have followed the saml example implementation here
https://github.com/vdenotaris/spring-boot-security-saml-sample
I have been following the AngularJS with Spring Security blog here
jasha.eu/blogposts/2015/10/saml-authentication-angularjs-spring-security.html
I’ve searched the internet for the solution to this and it seems like a common problem, and as per the spring security saml documentation this issue can be solved by setting the storageFactory property to the SAMLContextProviderImpl like so
#Bean
public SAMLContextProviderImpl contextProvider() {
SAMLContextProviderImpl samlContextProviderImpl = new SAMLContextProviderImpl();
samlContextProviderImpl.setStorageFactory(emptyStorageFactory());
return samlContextProviderImpl;
}
#Bean
public EmptyStorageFactory emptyStorageFactory() {
return new EmptyStorageFactory();
}
But still I am getting the same error.
I am using Spring Boot 1.5.4.RELEASE, Spring Security 4.2.3.RELEASE, spring-security-saml2-core:1.0.2.RELEASE, AngularJS 1.5.8
I am loading the sp and idp metadata locally to the spring saml config, but the idp is a remote entity and sp is local entity.
It is an angularjs based web application and application flow is supposed to be I hit the url that takes me to an insecure page with a login link, after I hit the login link I am sending a request to the sso controller that does a logical check on whether I am a authenticated user or not, if not I am supposed to be redirected to the sso for authentication.
Please provide your valuable input to help me in resolving this issue.
Thanks in advance.

WSO2 SSO with SAML 2 - Front End React.js (REDUX), SPRINGBOOT backend

I need to integrate a client application written with react and redux (spring boot backend) with WSO2 Single Sign-On (SAML 2.0) IDP
Do I need to make use of few node.js based packages such as "passport-saml" etc to achieve single sign-on with wso2 IDP?
Appreciate if you could share your thoughts/expertise/any reference links.
Thanks.
You can use OpenSAML(no longer maintained though) or a similar Java SAML assertion library for this.
Passport-js is specifically designed to work with nodejs. One way u could make use of passportJs is by implementing the authentication and authorization business logic of the application as a NodeJs based micro-service. AFAIK WSO2 IS works perfectly with passport-js.

Consuming Saml2.0 in MVC5 .net frame work 4.5 (Saml2.0 token is generated by F5 BigIp tool)

Current State of web application:
We have an existing web application designed in AngularJs, MVC5. Authentication is happening against our custom database.
SignIn:
We did over ride Microsoft.AspNet.Identity.UserManager and other source classes to talk to our database to get user related information.
adding the results to System.Security.Claims.ClaimsIdentity.
Passing on to "Microsoft.Owin.Security.IAuthenticationManager.SignIn(params System.Security.Claims.ClaimsIdentity[] identities)
What I need SSO:
We would like to move the auhentication to SSO with SAML 2.0 token as we are planning to integrate 2 new vendors into our web application
Identity Provider:
We are implementing Identity provider in F5 Big Ip which does the authentication by providing the login page and generates the saml2 token. Our web application would be configured as Service provider. On redirect to the web application it will pass on the saml2.0 token.
Consuming SAML2.0 in MVC .net framework 4.5.2
All my application would need is to consume saml2.0 token and integrate with existing authentication pipeline.
Things to do:
Meta data from Identity provider has public key to decrypt saml2.0 token and as well a key which is used to sign the meta data file
My assumption would be parse the request for SAML 2.0 token and verify if the token is valid and use the data from the attributes and query the database for more details and insert the results into "System.Security.Claims.ClaimsIdentity" and use the existing signin operation.
Need to figure out how to configure the principle.. and do we still need Microsoft.AspNet.Identity.UserManager.
Research:
In visual studio we had identity and access tool which doesnt exist from vs2013.
Went through the article on windows identity foundation and claims identity principle
www.codeproject.com/Articles/504399/Understanding-Windows-Identity-Foundation-WIF
I know wif support saml2.0 token but not saml2 protocols.
Here are the third party tools that was suggested to be used
http://nzpcmad.blogspot.co.nz/2013/06/saml-saml-connectivity-toolkit.html
I am not sure just to consume do I need to used one of the tool? As we have our IDP configured in F5 bigip and not designed in .net
Another good article I found
http://www.primaryobjects.com/2013/08/08/using-single-sign-on-with-windows-identity-foundation-in-mvc-net/
Also saw some suggestions about Saml2SecurityTokenHandler to process saml2.0 token.
I appreciate if someone can direct me to simpler solution to integrate to my existing web app. Just need to consume saml2.0 token and integrate with existing claims based authentication.
OK - then you have to use a SAML stack as per the link you used.
Have a look at Kentor - there's some examples on the site plus I did a write up
Update:
The way SAML works is that the client needs to send an AuthnRequest to the IDP, then the user authenticates and then the IDP sends a AuthnResponse to the client. The response contains the SAML token which contains the assertions (claims).

Resources