Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzie committed Jan 30, 2024
1 parent 8f35a68 commit 289eec8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions Example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
ports:
- 8080:8080
environment:
SecretKey: "YourSecretfrsfwafawfwafwfafwfawftKey"
DbType: InMemory
DbConnectionString:
volumes:
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ Rights to contribution made is transfered to repo owner immediately upon submiss

### Env Variables

| name | Description | Options |
| ----------------------------- | ------------------------------------------ | ------------------------------------- |
| DbType | Db type used to store app data | Postgres, SqlServer, Sqlite, InMemory |
| DbConnectionString (Optional) | Db connection string for none in-memory Db | |
| name | Description | Options |
| ----------------------------- | --------------------------------------------------------------- | ------------------------------------- |
| SecretKey | Secret string used for creating Symmetric Security Key at login | `random long string` |
| DbType | Db type used to store app data | Postgres, SqlServer, Sqlite, InMemory |
| DbConnectionString (Optional) | Db connection string for none in-memory Db | |

### Auth Config (auth.config.json)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task<IActionResult> Login(string username, string password,
{
claims.Add(new Claim(ClaimTypes.Role, role));
}
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["SecretKey"]));
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetValue<string>("SecretKey")));
var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);

var token = new JwtSecurityToken(
Expand Down

0 comments on commit 289eec8

Please sign in to comment.