ITfoxtec.Identity.Saml2 | ITfoxtec Identity Saml2 adds SAML-P support | Authentication library

 by   ITfoxtec C# Version: 4.8.7-beta1 License: BSD-3-Clause

kandi X-RAY | ITfoxtec.Identity.Saml2 Summary

kandi X-RAY | ITfoxtec.Identity.Saml2 Summary

ITfoxtec.Identity.Saml2 is a C# library typically used in Security, Authentication applications. ITfoxtec.Identity.Saml2 has no vulnerabilities, it has a Permissive License and it has low support. However ITfoxtec.Identity.Saml2 has 8 bugs. You can download it from GitHub.

The ITfoxtec Identity Saml2 package adds SAML-P support for both Identity Provider (IdP) and Relying Party (RP). The ITfoxtec Identity Saml2 package implements the most important parts of the SAML-P standard and some optional features. Message signing and validation as well as decryption is supported. The package supports SAML 2.0 login, logout, single logout and metadata. Both SP Initiated and IdP Initiated sign on is supported. Please see the test samples. The ITfoxtec Identity Saml2 package supports signing/encryption certificates in Azure Key Vault. Please see the TestWebAppCoreAzureKeyVault sample. The ITfoxtec Identity Saml2 package is tested for compliance with AD FS, Azure AD and Azure AD B2C. The ITfoxtec Identity Saml2 package supports the Danish NemLog-in2 (NemID) / OIOSAML 2 and NemLog-in3 (MitID and NemID) / OIOSAML 3. The TestWebAppCoreNemLogin3Sp sample application is configured (both as private IT system and public IT system) with NemLog-in3 and show how to implement an NemLog-in3 Service Provider (SP).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ITfoxtec.Identity.Saml2 has a low active ecosystem.
              It has 206 star(s) with 130 fork(s). There are 18 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 6 open issues and 82 have been closed. On average issues are closed in 48 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ITfoxtec.Identity.Saml2 is 4.8.7-beta1

            kandi-Quality Quality

              ITfoxtec.Identity.Saml2 has 8 bugs (0 blocker, 0 critical, 8 major, 0 minor) and 0 code smells.

            kandi-Security Security

              ITfoxtec.Identity.Saml2 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ITfoxtec.Identity.Saml2 code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              ITfoxtec.Identity.Saml2 is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ITfoxtec.Identity.Saml2 releases are available to install and integrate.
              It has 58227 lines of code, 0 functions and 262 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ITfoxtec.Identity.Saml2
            Get all kandi verified functions for this library.

            ITfoxtec.Identity.Saml2 Key Features

            No Key Features are available at this moment for ITfoxtec.Identity.Saml2.

            ITfoxtec.Identity.Saml2 Examples and Code Snippets

            No Code Snippets are available at this moment for ITfoxtec.Identity.Saml2.

            Community Discussions

            QUESTION

            Integrate a .net core solution with PingID
            Asked 2022-Mar-30 at 19:38

            I have a application build with .NET Core. This application is very simple, but the problem is that I have to integrate a 2FA app (PingId) for double security instead of one simple Login. I am guided to use SAML, for building bridges between Service Provider and Identity Provider. I have found some solutions online, and one of them that is open source is itfoxtec.identity.saml2.

            What I want to know is that, is there anyone who can clear the way how this works? I mean I cannot understand some url in appsetting.json file.

            Here is a demo of this file:

            https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestWebAppCore/appsettings.json

            For example IdPMetadata key is a xml file that has to be provided by Identity Provider administrator?

            SigningCertificateFile is a generated certificate by my Service Provider app or is something builded inside the application, if that is how to generate it?

            ...

            ANSWER

            Answered 2022-Mar-30 at 19:38

            Yes, the identity provider (IdP) should expose a SAML 2.0 metadata endpoint, the URL is added in the IdPMetadata.

            The TestIdPCore sample is for testing the samples and to show how to implement a SAML 2.0 based IdP.

            Your application (relaying party RP) needs a certificate, which is e.g., added as a file in SigningCertificateFile.

            Source https://stackoverflow.com/questions/71677061

            QUESTION

            Issue creating SamlResponse when following your example Idp code - within the LoginResponse method
            Asked 2022-Feb-18 at 03:41

            I have created an IDP using the code contained within https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/master/test/TestIdPCore/Controllers/AuthController.cs

            This is throwing an error when I attempt to bind the authNResponse using the following code:

            ...

            ANSWER

            Answered 2022-Jan-05 at 09:00

            Maybe you are missing the part of adding claims to the token and creating the token?

            Source https://stackoverflow.com/questions/70582295

            QUESTION

            Signature is invalid while calling Saml2PostBinding.Unbind()
            Asked 2021-Nov-12 at 08:53

            We are getting "Signature is invalid" errors while calling Unbind() and stumbled upon this in code. https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/blob/42a2d6de46f38d14f0c6f607594d19f2366ad5f2/src/ITfoxtec.Identity.Saml2/Bindings/Saml2PostBinding.cs#L106

            Why validateXmlSignature argmument is always true within UnbindInternal()?

            ...

            ANSWER

            Answered 2021-Nov-12 at 08:53

            The validateXmlSignature argument is always true because the signature is placed in XML in a POST binding and the SAML 2.0 Authn response signature has to be validated. The signature validation is the trust of the SAML 2.0 token.

            Source https://stackoverflow.com/questions/69911085

            QUESTION

            ITfoxtec SAML 2.0 - Single Logout
            Asked 2021-Oct-26 at 18:45

            I have one IdP and two SP's (A and B) setup. SSO works great between them. Single Logout also works when I logout from site A (it logs user out from site B too) but issue occurs when I am trying to logout from site B. It logs user out from site B but when I navigate to site A I'm still logged in until I delete session cookies or sessions times out.

            Site A uses ITfoxtec.Identity.Saml2 SAML2.0 MVC implementation.

            If I manually delete cookies and refresh the page I'm redirected to login page.

            It seems that it kills the session but session cookies persists in the browser and it lets user to browse until it expires, it cannot renew it.

            SingleLogout endpoint is the same as in example (Source from ITfoxtec.Identity.Saml2 - TestWebApp)

            Have you seen anything like it? I ran out of ideas what could be done in this case.

            ...

            ANSWER

            Answered 2021-Oct-26 at 18:45

            It is probably your IdP restricting sending the cookie to site A but not to site B when the browser is redirected from the IdP to site A. If it is the case you can try to use POST instead of redirect. POST are probably not be restricted.

            You can debug by tracing the HTTPS traffic in Fiddler or maybe in the browser.

            Source https://stackoverflow.com/questions/69727838

            QUESTION

            OpenAM ITfoxtec Saml2 invalid signature response?
            Asked 2021-Oct-26 at 09:03

            I'm trying to integrate OpenAM Saml SSO to my .net 5 application. ITfoxtec.Saml2 is used to handle the authentication on the SP. When trying to login, a valid post samlResponse is send. But when validating the response, I get following exception.

            ...

            ANSWER

            Answered 2021-Oct-26 at 09:03

            The ITfoxtec Identity Saml2 package do not read the IdP signing certificate in the EntityDescriptor/KeyDescriptor element, the element is not supported. The IdP certificate is read in the EntityDescriptor/IDPSSODescriptor/KeyDescriptor element.

            Valid IdP metadata sample for the TestIdPCore sample:

            Source https://stackoverflow.com/questions/69709135

            QUESTION

            How to read encrypted assertions?
            Asked 2021-Oct-26 at 08:48

            I'm writing a SAML2 service provider/relying party. My IdP is returning Assertions in an encrypted form (EncryptedAssertion element). Is this Assertion decryption scenario supported by ITfoxtec.Identity.Saml2? I'm getting this exception:

            ...

            ANSWER

            Answered 2021-Oct-25 at 13:12

            Finally got it! I just needed to set Saml2Configuration.DecryptionCertificate.

            Source https://stackoverflow.com/questions/69706061

            QUESTION

            Where do the /idp/ endpoints come from?
            Asked 2021-Oct-07 at 07:52

            I am trying to setup an authentication mechanism based on the new OIOSAML3.0. Using your https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/tree/master/test/TestWebAppCoreNemLogin3Sp works fine for me.

            However, having moved the various startup calls over into my own code I get a HTTP 404 on the redirects to '/idp/saml/3.0/?...'

            The same thing happends when I take your example, but change over to my own organisation metadata.

            I thought these endpoints would be setup by the call to AddSaml2() and UseSaml2() in Startup.cs but that does not seem to be the case.

            Can you lend any insight into where and how these endspoints are added to the project?

            ...

            ANSWER

            Answered 2021-Oct-07 at 07:52

            The IdP endpoint is read from the NemLog-in metadata. I the sample the NemLog-in metadata is in the TestWebAppCoreNemLogin3Sp-metadata.xml file.

            The NemLog-in metadata is read in Startup.cs line 39. And the endpoints is read in line 43 and 44.

            Source https://stackoverflow.com/questions/69382889

            QUESTION

            Ignore AuthenticationContext In SAML2 Response
            Asked 2021-Sep-14 at 15:44

            We have an asp.net 5 web app that will serve as a Service Provider to our users.
            We have chosen ITfoxtec Identity SAML 2.0 library for this purpose.
            The request is successful, but in the response we get the following error:

            System.ArgumentException: IDX13300: 'System.String' must be an absolute Uri, was: 'System.Uri'

            For completeness here is the full stack trace:

            Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenReadException: IDX13102: Exception thrown while reading 'System.String' for Saml2SecurityToken. Inner exception: 'System.ArgumentException'. ---> System.ArgumentException: IDX13300: 'System.String' must be an absolute Uri, was: 'System.Uri' at Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthenticationContext.set_DeclarationReference(Uri value) at Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer.ReadAuthenticationContext(XmlDictionaryReader reader) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer.ReadAuthenticationContext(XmlDictionaryReader reader) at Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer.ReadAuthenticationStatement(XmlDictionaryReader reader) at Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer.ReadAssertion(XmlReader reader) at Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler.ReadSaml2Token(XmlReader reader) at Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler.ReadSaml2Token(String token) at ITfoxtec.Identity.Saml2.Saml2AuthnResponse.ReadSecurityToken(String tokenString) at ITfoxtec.Identity.Saml2.Saml2AuthnResponse.Read(String xml, Boolean validateXmlSignature) at ITfoxtec.Identity.Saml2.Saml2PostBinding.Read(HttpRequest request, Saml2Request saml2RequestResponse, String messageName, Boolean validateXmlSignature) at ITfoxtec.Identity.Saml2.Saml2Binding1.ReadSamlResponse(HttpRequest request, Saml2Response saml2Response) at SsoGovILApi.Controllers.SamlController.AssertionConsumerService() in F:\Dev\ashilon\SsoGovIlApi\Controllers\SamlController.cs:line 45 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT1.ProcessRequestAsync()

            I have looked up the error and found that the authentication context can be ignored, and some libraries give this option, like this one for example:
            IgnoreAuthenticationContextInResponse compatibility flag

            Is there a way to this in the ITfoxtec library too?

            Thanks in advance,
            ashilon

            ...

            ANSWER

            Answered 2021-Sep-14 at 08:51

            You can implement you own version of Saml2AuthnResponse and on the Saml2SecurityTokenHandler property set your own implementation of Saml2ResponseSecurityTokenHandler.

            I think it should be possible to change the authentication context validation in your own implementation of the Saml2ResponseSecurityTokenHandler.

            Source https://stackoverflow.com/questions/69173406

            QUESTION

            How is IdP-initiated working with MVC in the ITFoxtec.Identity examples?
            Asked 2021-Aug-31 at 10:35

            I feel like I'm missing something, either in my understanding of SSO, or in how IdP-initiated in the example projects (MVC and Core) at ITFoxtec.Identity.Saml2 are working.

            It seems like the only project set up to be the IdP is TestIdPCore, yet the only projects that have IdPInitiatedController seem to be set up to only be an Service Provider (relying party?).

            I dropped IdPInitiatedController into TestIdPCore and was able to get Initiate() to work.

            I guess I am confused on how to get IdP-initiated working with the examples as they are.

            Thank you for your time, both in the work done and in your responses!

            ...

            ANSWER

            Answered 2021-Aug-31 at 10:35

            It sounds like you understand IdP-initiated correct. In the old days the solution did not contain the TestIdPCore IdP sample. Therefore, the IdP-initiated sample is placed in a SP (Service Provider). But you are right, I should move it to the IdP sample.

            If you like, you are welcome to do a pull request to move the IdP-initiated sample to the TestIdPCore IdP sample.

            Source https://stackoverflow.com/questions/68897947

            QUESTION

            Capable to keep logging-in on sample project in Azure with ITfoxtec SAML 2.0?
            Asked 2021-Jun-10 at 07:57

            I'm validating AAD-SSO for TestWebApp(ASP.NET MVC) ITfoxtec / ITfoxtec.Identity.Saml2.
            I confirmed login -> AAD sign-in -> Redirect to app but app still remains not logging-in.
            I assigned "https://localhost:***/Metadata" as Redirect Uri.
            I checked the other settings from another post. However that means the app only makes a xml file.

            Tell the procedure if there's anyone who succeeded logging-in on app?
            Or do I have to build new logic?
            e.g. of logic) receive session from AAD and

            ...

            ANSWER

            Answered 2021-Jun-10 at 07:57

            The https://localhost:***/Metadata is the metadata URL. AAD needs to redirect back to the applications AssertionConsumerService endpoint.

            You can have AAD reading the metadata or you can configure the AssertionConsumerService endpoint manually in AAD.

            Source https://stackoverflow.com/questions/67916717

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ITfoxtec.Identity.Saml2

            You can download it from GitHub.

            Support

            If you have questions please ask them on Stack Overflow. Tag your questions with 'itfoxtec-identity-saml2' and I will answer as soon as possible.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2.git

          • CLI

            gh repo clone ITfoxtec/ITfoxtec.Identity.Saml2

          • sshUrl

            git@github.com:ITfoxtec/ITfoxtec.Identity.Saml2.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link