Giter Club home page Giter Club logo

u2f_core's Introduction

Quality Gate Status .NET Core NuGet

.NET Universal 2nd Factor (U2F)

U2F is being depratcated in favor of FIDO2. A dotnet version can be found here https://github.com/passwordless-lib/fido2-net-lib This repository provides functionality for working with the server side aspects of the U2F protocol on .NET core framework.

Working Demo Site

https://bfoster.me/U2FDemo/DemoHome

NuGet page

https://www.nuget.org/packages/U2F.Core

Original source JAVA library is located below

https://github.com/Yubico/java-u2flib-server

Useful links

License

MIT License

Copyright (c) 2021 Bryce Foster

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

u2f_core's People

Contributors

brucedog avatar dbeinder avatar dependabot[bot] avatar kspearrin 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  avatar

Watchers

 avatar  avatar  avatar

u2f_core's Issues

Firefox incompatibility

Should this work in Firefox?

I am using U2F.Core in my own application and it works great in Chrome. I see odd behavior in Firefox. Device registration works fine, but Authenticating with the device gives an errorCode 2.

When trying to use your demo site in Firefox, it does not work for me at all (device does not enable for input).

GitHub, Facebook, other U2F implementations work fine.

Is this compatible in Safari 13.1.2?

When attempting to register a device on the demo site in Safari 13.1.2, I get the model pop-up prompting U2F interaction but my U2F key does not begin blinking for interaction.

I am using Yubikey 5C Nano.

Registration/Authentication works from most other U2F compatible sites (GitHub, Yubico Demo Site).

"Error when verifying signature" on Linux Host with v2.0.0

Just upgraded to v2.0.0 and am testing it out. It works great on Windows, however, fails on Linux (maybe macOS too, have not tested that).

Trying to call FinishRegistration on a Linux (Debian) host causes U2fException (Error when verifying signature). Stack trace shows it coming from the CheckSignature method.

Reverting back to v1.0.4 resolves the problem.

U2F.Core.Exceptions.U2fException: Error when verifying signature
   at U2F.Core.Crypto.CryptoService.CheckSignature(X509Certificate2 attestationCertificate, Byte[] signedBytes, Byte[] signature)
   at U2F.Core.Models.RawRegisterResponse.CheckSignature(String appId, String clientData)
   at U2F.Core.Crypto.U2F.FinishRegistration(StartedRegistration startedRegistration, RegisterResponse tokenResponse, HashSet`1 facets)
   at Bit.Core.Services.UserService.CompleteU2fRegistrationAsync(User user, Int32 id, String name, String deviceResponse) in /home/bitwarden/Projects/bitwarden/core/src/Core/Services/Implementations/UserService.cs:line 330
   at Bit.Api.Controllers.TwoFactorController.PutU2f(TwoFactorU2fRequestModel model) in /home/bitwarden/Projects/bitwarden/core/src/Api/Controllers/TwoFactorController.cs:line 221
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()

My guess is some break in the new crypto libs being used.

Firefox support

Hi Bryce,

My Yubico FIDO U2F key is working with the Yubico's test site (https://demo.yubico.com/u2f) using both Chrome 63 and FF 57.0.2.

I also have your U2F test application working with Chrome 63. However, I've not been able to get it to work with FF 57.0.2. With FF, the Finish Authentication page displays but the key never starts blinking. I also tried using the latest u2f-api (https://demo.yubico.com/js/u2f-api.js) but neither Chrome or FF works with the test app with the latest api--the key never starts blinking on the Finish Authentication page.

Maybe you've run into this sort of thing before? Thanks for any help or ideas you have.

Best,

  • Jeff

Possible to use with WebAuthn?

Do you know if it is possible to use U2F_Core on the server for performing the same U2F operations while using WenAuthn APIs on the client? We are looking to migrate our clients to WebAuthn and I am not sure if it will work.

VS2017 Requirement

I am unable to open the solution source code in VS2015 because the VS2017 csproj files are not backwards compatible with VS2015.

Thinking about creating a new empty ASP.Core project in VS2015 and trying to manually copy the U2F_Core source files into the empty VS2015 project. Do you think manually porting the source to VS2015 would work? Can you offer any guidance or suggestions on reconstructing from a new project?

I realize I could get the compiled U2F_Core DLL via NuGet but I'd really like to work directly with the source to understand how it works.

The overall goal is investigate using the library with a VS2015 ASP.Core 1.1 web application (full-framework 4.5.2) with ASP.NET Core Identity.

Thanks!

Remove Bouncy Castle Dependency

Would you be open to dumping the bouncy castle dependency in favor of standard framework crypto or are you trying to keep everything 1-1 with the java implementation? With .NET Core 2.0 we should be able to do all of the needed crypto.

NuGet Package Broken

NuGet package does not seem to work.

  1. Create a new, blank ASP.NET Core website project. (my test was with a Full Framework project).
  2. Launch website. Observe it works just fine.
  3. Run Install-Package U2F.Core
  4. Launch website. Observe error on startup:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
Inner Exception:
FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

When adding the package from NuGet it shows that there are no dependencies, which definitely isn't right either. https://www.nuget.org/packages/U2F.Core

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.