Code Monkey home page Code Monkey logo

Comments (10)

admalledd avatar admalledd commented on August 24, 2024 5

Note, the root cause is that the types registered at the ctor() RSAPKCS1SHA256SignatureDescription() are using "typeof(...).FullNameand deep in the signature verification on MS's side they doType.GetType(string)`. As this stack overflow hints, using the assembly qualified name instead works.
Thus changing the ctor() to:

        public RSAPKCS1SHA256SignatureDescription()
        {
            //https://stackoverflow.com/a/1825156/494125
            KeyAlgorithm = typeof(RSACryptoServiceProvider).AssemblyQualifiedName;
            DigestAlgorithm = typeof(SHA256Managed).AssemblyQualifiedName;   // Note - SHA256CryptoServiceProvider is not registered with CryptoConfig
            FormatterAlgorithm = typeof(RSAPKCS1SignatureFormatter).AssemblyQualifiedName;
            DeformatterAlgorithm = typeof(RSAPKCS1SignatureDeformatter).AssemblyQualifiedName;
        }

from aspnetsaml.

alex-jitbit avatar alex-jitbit commented on August 24, 2024 4

We've actually removed this code altogether, needed for pre-4.5 .NET versions anyway. Currently testing in production, will push updates here next week.

from aspnetsaml.

apexdodge avatar apexdodge commented on August 24, 2024 1

@alex-jitbit I got it working by removing all references to these:

RSAPKCS1SHA256SignatureDescription.Init()

There are two places in the code where that is called, and I commented them out and it works now.

image

I suspect that code conflicts with .net core / .net 5.

I hope that helps you and anyone else running into the problem.

from aspnetsaml.

alex-jitbit avatar alex-jitbit commented on August 24, 2024

So, signedXml is null in debug?

PS. The onelogin's samltool.com you mentioned does not verify signatures at all, so checking the response their - does not actually confirm validity

from aspnetsaml.

apexdodge avatar apexdodge commented on August 24, 2024

@alex-jitbit signedXml is not null:

image

ValidateSignatureReference() returns true and !isExpired == true, so we are good on those.

Noted on samltool.com. I tested it on https://8gwifi.org/samlverifysign.jsp - not sure if that site is better.

When I select these two options: https://s3.amazonaws.com/vo-random/ShareX/2020/11/chrome_RGe1ylqkfL.png - it passes.

image

from aspnetsaml.

alex-jitbit avatar alex-jitbit commented on August 24, 2024

Then probably the certificate is null. I haven't tested this on .NET Core a lot, will look into this

from aspnetsaml.

ppmBeebie avatar ppmBeebie commented on August 24, 2024

@alex-jitbit I'm waiting for your update

from aspnetsaml.

ppmBeebie avatar ppmBeebie commented on August 24, 2024

@ @admalledd Thank you

from aspnetsaml.

RayWillett avatar RayWillett commented on August 24, 2024

see #64. Looks like the referenced updates are available from source on github, but have not been published to nuget yet. It's fairly simple to swap out the nuget reference for a reference to the source code directly in your project.

from aspnetsaml.

shotttik avatar shotttik commented on August 24, 2024

Thank you, that worked

from aspnetsaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.