You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/fundamentals/index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ Blazor documentation adopts several conventions for showing and discussing compo
69
69
*[Component parameter](xref:blazor/components/index#component-parameters) values lead with a [Razor reserved `@` symbol](xref:mvc/views/razor#razor-syntax), but it isn't required. Literals (for example, boolean values), keywords (for example, `this`), and `null` as component parameter values aren't prefixed with `@`, but this is also merely a documentation convention. Your own code can prefix literals with `@` if you wish.
70
70
* C# classes use the [`this` keyword](/dotnet/csharp/language-reference/keywords/this) and avoid prefixing fields with an underscore (`_`) that are assigned to in constructors, which differs from the [ASP.NET Core framework engineering guidelines](https://github.com/dotnet/aspnetcore/wiki/Engineering-guidelines).
71
71
* In examples that use [primary constructors (C# 12 or later)](/dotnet/csharp/whats-new/tutorials/primary-constructors), primary constructor parameters are typically used directly by class members.
72
+
* In article code examples, the code lines are artificially broken across two or more lines to eliminate or reduce horizontal scrolling of the article's code blocks. The code executes regardless of these artificial line breaks, but you're welcome to condense the code in your own apps by removing the artificial line breaks after you paste the code into a project.
72
73
73
74
Additional information on Razor component syntax is provided in the *Razor syntax* section of <xref:blazor/components/index#razor-syntax>.
This article explains how to configure an ASP.NET Core Blazor Web App with QR code generation for Time-based One-time Password Algorithm (TOTP) authenticator apps.
14
+
This article explains how to configure an ASP.NET Core Blazor Web App for two-factor authentication (2FA) with QR codes generated by Time-based One-time Password Algorithm (TOTP) authenticator apps.
15
15
16
-
For an introduction to two-factor authentication (2FA) using a TOTP authenticator app, see <xref:security/authentication/identity-enable-qrcodes>.
16
+
For an introduction to 2FA with TOTP authenticator apps, see <xref:security/authentication/identity-enable-qrcodes>.
17
17
18
18
> [!WARNING]
19
-
> TOTP codes should be kept secret because it can be used to authenticate successfully multiple times before it expires.
19
+
> TOTP codes should be kept secret because they can be used to authenticate multiple times before they expire.
20
20
21
21
## Scaffold the Enable Authenticator component into the app
22
22
@@ -33,9 +33,9 @@ For more information, see <xref:security/authentication/scaffold-identity>. For
33
33
34
34
## Adding QR codes to the 2FA configuration page
35
35
36
-
QR codes for use by TOTP authenticator apps must be generated by a QR code library.
36
+
A QR code generated by the app to set up 2FA with an TOTP authenticator app must be generated by a QR code library.
37
37
38
-
The guidance in this article uses [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator), but you can use any general QR code generation library.
38
+
The guidance in this article uses [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator), but you can use any QR code generation library.
39
39
40
40
Download the [`qr-creator.min.js`](https://cdn.jsdelivr.net/npm/qr-creator/dist/qr-creator.min.js) library to the solution's server project. The library has no dependencies. If you intend to use the library to generate other QR codes elsewhere in the app for your own purposes, there's also a module version of the library available from the maintainer (see the [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator) GitHub repository for details).
This article explains how to configure an ASP.NET Core Blazor WebAssembly app with Identity with QR code generation for Time-based One-time Password Algorithm (TOTP) authenticator apps.
14
+
This article explains how to configure an ASP.NET Core Blazor WebAssembly app with Identity for two-factor authentication (2FA) with QR codes generated by Time-based One-time Password Algorithm (TOTP) authenticator apps.
15
15
16
-
> [!NOTE]
17
-
> This article only applies standalone Blazor WebAssembly apps with a server backend web API that adopts ASP.NET Core Identity. To implement QR code generation for Blazor Web Apps, see <xref:blazor/security/qrcodes-for-authenticator-apps>.
18
-
19
-
For an introduction to two-factor authentication (2FA) using a TOTP authenticator app, see <xref:security/authentication/identity-enable-qrcodes>.
16
+
For an introduction to 2FA with TOTP authenticator apps, see <xref:security/authentication/identity-enable-qrcodes>.
20
17
21
18
> [!WARNING]
22
-
> TOTP codes should be kept secret because it can be used to authenticate successfully multiple times before it expires.
19
+
> TOTP codes should be kept secret because they can be used to authenticate multiple times before they expire.
23
20
24
21
## Namespaces and article code examples
25
22
@@ -34,17 +31,17 @@ If you aren't using the `BlazorWebAssemblyStandaloneWithIdentity` sample, change
34
31
35
32
All of the changes to the solution covered by this article take place in the `BlazorWasmAuth` project.
36
33
37
-
In this article's code examples, the code lines are artificially broken across two or more lines to eliminate or reduce horizontal scrolling of the article's code blocks. The code executes regardless of these artificial line breaks. You're welcome to condense the code in your own apps by removing the artificial line breaks after you paste the code into a project.
34
+
In this article's code examples, the code lines are artificially broken across two or more lines to eliminate or reduce horizontal scrolling of the article's code blocks. The code executes regardless of these artificial line breaks, but you're welcome to condense the code by removing the artificial line breaks after you paste the code into a project.
38
35
39
36
## Optional account confirmation and password recovery
40
37
41
38
Although apps that implement 2FA authentication often adopt account confirmation and password recovery features, 2FA authentication doesn't require it. The guidance in this article can be followed to implement 2FA without following the guidance in <xref:blazor/security/webassembly/standalone-with-identity/account-confirmation-and-password-recovery>.
42
39
43
40
## Add a QR code library to the app
44
41
45
-
QR codes for use by TOTP authenticator apps must be generated by a QR code library.
42
+
A QR code generated by the app to set up 2FA with an TOTP authenticator app must be generated by a QR code library.
46
43
47
-
The guidance in this article uses [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator), but you can use any general QR code generation library.
44
+
The guidance in this article uses [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator), but you can use any QR code generation library.
48
45
49
46
Download the [`qr-creator.min.js`](https://cdn.jsdelivr.net/npm/qr-creator/dist/qr-creator.min.js) library to the `wwwroot` folder of the client project. The library has no dependencies. If you intend to use the library to generate other QR codes elsewhere in the app for your own purposes, there's also a module version of the library available from the maintainer (see the [`nimiq/qr-creator`](https://github.com/nimiq/qr-creator) GitHub repository for details).
0 commit comments