Skip to content

Commit

Permalink
Updated the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Jul 14, 2023
1 parent 4a4e806 commit 2dbf03c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It showcases:
- OpenAPI
- User management with ASP.NET Core Identity
- Cookie authentication
- JWT authentication
- Bearer authentication
- Proxying requests from the front end application server using YARP's IHttpForwarder
- Rate Limiting
- Writing integration tests for your REST API
Expand All @@ -32,14 +32,6 @@ It showcases:
1. Run `dotnet ef database update` to create the database.
1. Learn more about [dotnet-ef](https://learn.microsoft.com/en-us/ef/core/cli/dotnet)

### JWT

1. To initialize the keys for JWT generation, run `dotnet user-jwts` in to [TodoApi](TodoApi) folder:

```
dotnet user-jwts create
```

### Running the application
To run the application, run both the [Todo.Web/Server](Todo.Web/Server) and [TodoApi](TodoApi). Below are different ways to run both applications:
- **Visual Studio** - Setup multiple startup projects by right clicking on the solution and selecting Properties. Select `TodoApi` and `Todo.Web.Server` as startup projects.
Expand Down Expand Up @@ -117,13 +109,18 @@ Before executing any requests, you need to create a user and get an auth token.
"password": "<put a password here>"
}
```
1. To get a token for the above user run `dotnet user-jwts` to create a JWT token with the same user name specified above e.g:
1. To get a token for the above user, hit the `/users/token` endpoint with the above user name and password. The response will look like this:

```json
{
"token_type": "Bearer",
"access_token": "string",
"expires_in": <seconds>,
"refresh_token": "string"
}
```
dotnet user-jwts create -n myuser
```

1. You should be able to use this token to make authenticated requests to the todo endpoints.
1. Learn more about [user-jwts](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/security?view=aspnetcore-7.0#using-dotnet-user-jwts-to-improve-development-time-testing)

### Social authentication

Expand Down

2 comments on commit 2dbf03c

@GeeSuth
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "Bearer authentication" here is the same of "OAuth 2.0"?

@davidfowl
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not.

Please sign in to comment.