Coder Social home page Coder Social logo

scottbrady91 / fido2-poc Goto Github PK

View Code? Open in Web Editor NEW
36.0 5.0 12.0 285 KB

FIDO2 & WebAuthn Proof of Concept

Home Page: https://www.scottbrady91.com/FIDO/A-FIDO2-Primer-and-Proof-of-Concept-using-ASPNET-Core

License: MIT License

C# 100.00%
fido2 webauthn aspnetcore passwordless

fido2-poc's Introduction

I help developers learn OAuth and web security.

I'm an Engineering Manager at ClearBank and a Pluralsight Author. I specialize in IdentityServer and all things Authentication, Identity, OAuth, and OpenID Connect.

In my day job at ClearBank, I'm an Engineering Manager for one of the Faster Payments teams. I'm currently taking a break from the identity world to focus on my leadership skills.

Previously at 10x Banking, I was a combination of team lead and technical product manager, leading a team of experienced IAM specialists while also championing identity standards and helping with design & architecture. Before that, at Rock Solid Knowledge, I created identity solutions for customers and developed commercial IdentityServer products. This allowed me to play with older protocols such as SAML & WS-Federation and cutting-edge technologies such as FIDO2.

I mainly work with C# and ASP.NET Core, but otherwise, I dabble with languages such as Kotlin, Go, and Typescript.

I sometimes make an appearance on the speaking circuit, whether it's user groups, conferences, or recorded.

πŸ‘¨β€πŸ”§ Website: scottbrady91.com

🐀 Twitter: @scottbrady91

πŸ’Ό LinkedIn: scottbrady91

πŸ§‘ Timeline: my Polywork timeline

fido2-poc's People

Contributors

dependabot[bot] avatar scottbrady91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fido2-poc's Issues

Nice implementation.. but doesn't work.

Counter value comes back as incorrect:

Counterbuf 0,0,4,166

Counter 2785280000

Also:
var isValid = ecDsa.VerifyData(sigBase, DeserializeSignature(sig), HashAlgorithmName.SHA256);

comes back as False even though it's just been registered.

Use the .net ASN reader instead of parsing it manually

Instead of parsing the EcDSA signature in DeserializeSignature() (in AccountController.cs) you could use the build-in .net AsnReader.

You only have to do this fΓΌr EcDSA. RSA and EdDSA use the signature without any parsing. The odd behaviour of EcDSA is for compatibility reasons with the original U2F spec.

                var s = Base64Url.Decode(signature);
                var reader = new AsnReader(s, AsnEncodingRules.DER);
                var sequence = reader.ReadSequence(Asn1Tag.Sequence);
                var r = sequence.ReadIntegerBytes(Asn1Tag.Integer);
                var s = sequence.ReadIntegerBytes(Asn1Tag.Integer);

                // remove negative flags
                if (r.Span[0] == 0x0)
                {
                    r = r[1..];
                }

                if (s.Span[0] == 0x0)
                {
                    s = s[1..];
                }

                // combine r and s
                var signature = new byte[r.Length + s.Length];
                var signatureSpan = signature.AsSpan();
                r.Span.CopyTo(signatureSpan);
                s.Span.CopyTo(signatureSpan[r.Length..]);

                return signature;

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.