https://github.com/leanwit/authexample
.Net Core project example with basic authentication between Razor Web Project and WebApi Project using different roles and permissions.
https://github.com/leanwit/authexample
basic-authentication csharp netcore-mvc netcore-webapi netcore2 swagger
Last synced: 5 months ago
JSON representation
.Net Core project example with basic authentication between Razor Web Project and WebApi Project using different roles and permissions.
- Host: GitHub
- URL: https://github.com/leanwit/authexample
- Owner: Leanwit
- Created: 2019-06-08T15:38:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T01:42:49.000Z (over 6 years ago)
- Last Synced: 2025-07-10T23:57:09.138Z (7 months ago)
- Topics: basic-authentication, csharp, netcore-mvc, netcore-webapi, netcore2, swagger
- Language: C#
- Homepage:
- Size: 784 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AuthExample
.Net Core project example with basic authentication between Razor Web Project and WebApi Project using different roles and permissions.
[](https://ci.appveyor.com/project/Leanwit/authexample)
# Getting Started
All commands described in this section will be executed in root project after cloning the repository.
## Prerequisites
[.Net Core 2.2](https://dotnet.microsoft.com/download)
## Installing
```
dotnet build
```
## How to run
##### WebApi
```
dotnet run --project src/WebApi/WebApi.csproj
```
WebApi run in https://localhost:5001 by default.
##### Web
```
dotnet run --project src/Web/Web.csproj
```
Web run in https://localhost:1000 by default.
To log in, you can see all users and password created by default in [_src/WebApi/Infrastructure/Persistence/Seed/UserDataGenerator.cs_](https://github.com/Leanwit/AuthExample/blob/master/src/WebApi/Infrastructure/Persistence/Seed/UserDataGenerator.cs).
Examples:
* admin:admin
* pageone:pageone
## Running tests
```
dotnet test
```
It is also possible to execute tests per project.
```
dotnet test test/WebApi.Test
dotnet test test/Web.Test
```
Get coverage value using msbuild.
```
dotnet test /p:CollectCoverage=true /p:Exclude="[xunit.*]*
```
or you can check the last build [here](https://ci.appveyor.com/project/Leanwit/authexample).
# Next steps
[Issue List](https://github.com/Leanwit/AuthExample/issues)