Skip to content

Commit 24661e9

Browse files
authored
Simplify readme (#73)
1 parent 185a2e3 commit 24661e9

File tree

2 files changed

+30
-62
lines changed

2 files changed

+30
-62
lines changed

README.md

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,9 @@
22

33
The official [Bitwarden Passwordless.dev](https://passwordless.dev) .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.2+.
44

5-
## Installation
5+
## Install
66

7-
Install the [NuGet Package](https://nuget.org/packages/Passwordless):
8-
9-
- Using the [.NET CLI](https://docs.microsoft.com/en-us/dotnet/core/tools):
10-
11-
```sh
12-
dotnet add package Passwordless
13-
```
14-
15-
- Using the [NuGet CLI](https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference):
16-
17-
```sh
18-
nuget install Passwordless
19-
```
20-
21-
- Using the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console):
22-
23-
```powershell
24-
Install-Package Passwordless
25-
```
26-
27-
- From within Visual Studio:
28-
29-
1. Open the Solution Explorer.
30-
2. Right-click on a project within your solution.
31-
3. Click on *Manage NuGet Packages...*
32-
4. Click on the *Browse* tab and search for "Passwordless".
33-
5. Click on the Passwordless package, select the appropriate version in the
34-
right-tab and click *Install*.
7+
- [NuGet](https://nuget.org/packages/Passwordless): `dotnet add package Passwordless`
358

369
## See also
3710

@@ -41,14 +14,16 @@ Integration packages:
4114

4215
Examples:
4316

44-
- [Passwordless.Example](examples/Passwordless.Example) — basic Passwordless.dev integration inside an ASP.NET Core app
17+
- [Passwordless.Example](examples/Passwordless.Example) — basic Passwordless.dev integration inside an ASP.NET app
4518
- [Passwordless.AspNetIdentity.Example](examples/Passwordless.AspNetIdentity.Example) — Passwordless.dev integration using ASP.NET Identity.
4619

47-
## Getting started
20+
## Usage
4821

4922
💡 See the full [Getting started guide](https://docs.passwordless.dev/guide/get-started.html) in the official documentation.
5023

51-
### Register using Dependency Injection
24+
### Resolve the client
25+
26+
Add Passwordless to your service container:
5227

5328
```csharp
5429
// In Program.cs or Startup.cs
@@ -59,8 +34,26 @@ services.AddPasswordlessSdk(options =>
5934
});
6035
```
6136

37+
Inject the client into your controller:
38+
39+
```csharp
40+
public class HomeController : Controller
41+
{
42+
private readonly IPasswordlessClient _passwordlessClient;
43+
44+
public HomeController(IPasswordlessClient passwordlessClient)
45+
{
46+
_passwordlessClient = passwordlessClient;
47+
}
48+
49+
// ...
50+
}
51+
```
52+
6253
### Register a passkey
6354

55+
Define an action or an endpoint to generate a registration token:
56+
6457
```csharp
6558
[HttpGet("/create-token")]
6659
public async Task<IActionResult> GetRegisterToken(string alias)
@@ -94,6 +87,8 @@ public async Task<IActionResult> GetRegisterToken(string alias)
9487

9588
### Verify user
9689

90+
Define an action or an endpoint to verify a signin token:
91+
9792
```csharp
9893
[HttpGet("/verify-signin")]
9994
public async Task<IActionResult> VerifySignInToken(string token)

src/Passwordless.AspNetCore/README.md

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,9 @@
22

33
The official [Bitwarden Passwordless.dev](https://passwordless.dev) ASP.NET Identity integration. Automatically adds endpoints to verify passwordless signin and sign the user in using the existing ASP.NET Identity code.
44

5-
## Installation
5+
## Install
66

7-
Install the [NuGet Package](https://nuget.org/packages/Passwordless.AspNetCore):
8-
9-
- Using the [.NET CLI](https://docs.microsoft.com/en-us/dotnet/core/tools):
10-
11-
```sh
12-
dotnet add package Passwordless.AspNetCore
13-
```
14-
15-
- Using the [NuGet CLI](https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference):
16-
17-
```sh
18-
nuget install Passwordless.AspNetCore
19-
```
20-
21-
- Using the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console):
22-
23-
```powershell
24-
Install-Package Passwordless.AspNetCore
25-
```
26-
27-
- From within Visual Studio:
28-
29-
1. Open the Solution Explorer.
30-
2. Right-click on a project within your solution.
31-
3. Click on *Manage NuGet Packages...*
32-
4. Click on the *Browse* tab and search for "Passwordless.AspNetCore".
33-
5. Click on the Passwordless.AspNetCore package, select the appropriate version in the
34-
right-tab and click *Install*.
7+
- [NuGet](https://nuget.org/packages/Passwordless.AspNetCore): `dotnet add package Passwordless.AspNetCore`
358

369
## Usage
3710

@@ -53,7 +26,7 @@ app.MapPasswordless();
5326
app.Run();
5427
```
5528

56-
### Using MVC
29+
### Using Startup class
5730

5831
```csharp
5932
// In Startup.cs

0 commit comments

Comments
 (0)