Currently, SimpleAuthentication allows configuration for ApiKey and Basic authentication schemes, including specifying fixed API keys and credentials. However, there is no way to specify the list of roles for a user when using these methods.
Requested enhancement:
- Add a
Roles parameter (array of strings) to both ApiKey and Basic authentication configuration sections.
- When validating credentials (ApiKey or Basic), if
Roles is specified, automatically populate the role claim for the corresponding user.
- The
Roles list should be optional; if omitted, no roles are assigned.
- Update the README.md file to document this feature, including examples for both configuration and expected claim population.
Example configuration:
"Authentication": {
"ApiKey": {
"ApiKeys": [
{
"Value": "key-1",
"UserName": "UserName1",
"Roles": ["Admin", "User"]
}
]
},
"Basic": {
"Credentials": [
{
"UserName": "UserName1",
"Password": "Password1",
"Roles": ["Manager"]
}
]
}
}
This enhancement will provide more fine-grained control over user claims and simplify role assignment for fixed credentials.
Currently, SimpleAuthentication allows configuration for ApiKey and Basic authentication schemes, including specifying fixed API keys and credentials. However, there is no way to specify the list of roles for a user when using these methods.
Requested enhancement:
Rolesparameter (array of strings) to both ApiKey and Basic authentication configuration sections.Rolesis specified, automatically populate the role claim for the corresponding user.Roleslist should be optional; if omitted, no roles are assigned.Example configuration:
This enhancement will provide more fine-grained control over user claims and simplify role assignment for fixed credentials.
Rolesarray