Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dotnet format
### Running Demo Applications

```bash
# Run ASP.NET Core demo (requires HTTPS, expected at https://localhost:44329)
# Run ASP.NET Core demo (requires HTTPS, expected at https://localhost:5001)
dotnet run --project Demo/Demo.csproj

# Run Blazor WebAssembly demo
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Since Fido2-net-lib is part of the .NET Foundation, we ask our contributors to a

## To run the project locally

Start Fido2Demo (preferably https, expected url https://localhost:44329) and open https://localhost:44329/ in the browser.
Start Fido2Demo (preferably https, expected url https://localhost:5001) and open https://localhost:5001/ in the browser.
You also need to either set the MetadataService to `null` or add the applicationSettings as described below.

The HTML and javascript is copied (and then updated) from WebAuthn.io.
Expand Down
4 changes: 2 additions & 2 deletions Demo/TestController.cs → Demo/ConformanceTestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

namespace Fido2Demo;

public class TestController : Controller
public class ConformanceTestController : Controller
{
/* CONFORMANCE TESTING ENDPOINTS */
private static readonly DevelopmentInMemoryStore _demoStorage = new();

private readonly IFido2 _fido2;
private readonly string _origin;

public TestController(IOptions<Fido2Configuration> fido2Configuration)
public ConformanceTestController(IOptions<Fido2Configuration> fido2Configuration)
{
_origin = fido2Configuration.Value.FullyQualifiedOrigins.FirstOrDefault();

Expand Down
4 changes: 2 additions & 2 deletions Demo/Controller.cs → Demo/DemoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
namespace Fido2Demo;

[Route("api/[controller]")]
public class MyController : Controller
public class DemoController : Controller
{
private IFido2 _fido2;
public static IMetadataService _mds;
public static readonly DevelopmentInMemoryStore DemoStorage = new();

public MyController(IFido2 fido2)
public DemoController(IFido2 fido2)
{
_fido2 = fido2;
}
Expand Down
4 changes: 2 additions & 2 deletions Demo/Pages/dashboard.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Layout = "_Layout.cshtml";

// Please know that this is not good for production:
var DemoStorage = MyController.DemoStorage;
var _mds = MyController._mds;
var DemoStorage = DemoController.DemoStorage;
var _mds = DemoController._mds;

var username = Model.Username;

Expand Down
3 changes: 0 additions & 3 deletions Demo/Pages/usernameless.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
Please note: Your browser does not seem to support WebAuthn yet. <a href="https://caniuse.com/#search=webauthn" target="_blank">Supported browsers</a>
</div>

<div class="notification is-warning">
Please note: At the time of writing (July 2019) this is not supported on all browsers. Confirmed to work on: Windows Edge, Edge (OS X, pre-release), Firefox 69 (Windows), Chrome 76.0.3809.72 beta (OS X)
</div>
<div class="columns">
<div class="column is-4">

Expand Down
6 changes: 3 additions & 3 deletions Demo/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4728/",
"sslPort": 44329
"applicationUrl": "https://localhost:5001/",
"sslPort": 5001
}
},
"profiles": {
Expand All @@ -20,7 +20,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:4729/;https://localhost:44329/"
"applicationUrl": "https://localhost:5001/"
}
}
}
3 changes: 3 additions & 0 deletions Demo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseRewriter(new RewriteOptions().AddRedirectToWWwIfPasswordlessDomain());
}

// Enforce HTTPS redirection for all requests
app.UseHttpsRedirection();

app.UseSession();
app.UseStaticFiles();
app.UseRouting();
Expand Down
2 changes: 1 addition & 1 deletion Demo/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fido2": {
"serverDomain": "localhost",
"origins": [ "https://localhost:44329" ],
"origins": [ "https://localhost:5001" ],
"timestampDriftTolerance": 300000,
"backupEligibleCredentialPolicy": "allowed",
"backedUpCredentialPolicy": "allowed"
Expand Down
4 changes: 2 additions & 2 deletions Demo/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44329/",
"sslPort": 44329
"applicationUrl": "https://localhost:5001/",
"sslPort": 5001
}
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ public class AuthController : Controller
## Examples

- **[ASP.NET Core Demo](Demo/)** - Complete implementation with registration and authentication
- **[Demo Controller](Demo/DemoController.cs)** - Main demo API endpoints for registration and authentication
- **[Blazor WebAssembly Demo](BlazorWasmDemo/)** - Client-side Blazor example
- **[Test Controller](Demo/TestController.cs)** - Conformance test examples
- **[Conformance Test Controller](Demo/ConformanceTestController.cs)** - Conformance testing endpoints

For integration patterns, see:

Expand Down
Loading