crab-role-based-acl
v1.0.2
Published
JWT authorization with role based access by Kraken Team!!!
Downloads
49
Maintainers
Readme
crab-role-based-acl
Install
npm install --save crab-role-based-acl
Features
- Init JWT authentication
- Role base access authorization support
- Express middleware support
Install
- Install crab-role-based-acl
npm install crab-role-based-acl
How it work
Middlewares
import { roleBasedAuthorization, validAuthentication, validSupportOrigin } from "crab-role-based-acl";
1. validAuthentication
Using json web token to basic authentication.
valid request:
headers:
{
"Authorization": {jwtToken}
}
2. validSupportOrigin
Using json web token to fitlering token support request origin.
valid token:
token payload: {
'allowed-origins': [listSupportOrigin]
}
3. roleBasedAuthorization
Using role-based access to authorization
used:
roleBasedAuthorization(allowRolesString)
valid allow roles string:
- role name with sso sever defines
- multiple role names with
","
- allow all roles with
allowRolesString = "*"
LICENSE
MIT