Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/authress/express-starter-kit
The Authress Starter Kit for Express. Includes Authentication, Authorization, user identity and role management
https://github.com/authress/express-starter-kit
api authentication authorization authress backend express expressjs javascript security service starter-kit typescript
Last synced: 4 days ago
JSON representation
The Authress Starter Kit for Express. Includes Authentication, Authorization, user identity and role management
- Host: GitHub
- URL: https://github.com/authress/express-starter-kit
- Owner: Authress
- License: apache-2.0
- Created: 2023-03-15T21:06:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T15:33:24.000Z (11 months ago)
- Last Synced: 2024-11-18T13:51:55.933Z (2 months ago)
- Topics: api, authentication, authorization, authress, backend, express, expressjs, javascript, security, service, starter-kit, typescript
- Language: TypeScript
- Homepage: https://authress.io
- Size: 91.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Authress Starter Kit: Express + Typescript
The Express Starter Kit for Authress includes Authentication, Authorization, user identity and role managementThis is an example built specifically for using Authress with Typescript & Express.
## How to use this repository
To test and run the example:
* `npm install` or `yarn`
* `npm start` or `yarn start`
* And then use `curl` or `postman` to hit any of the endpoints.## See the code
If you just want to see the code, it's available right here. Most of it is boilerplate to run the example the interesting part starts a bit lower down.* [index.ts](./src/index.ts#L43)
There are three controllers, they all use Authress in some way to authorize the request and check the users permissions:
* [Accounts](./src/accounts/accountController.ts) - General creating an account and setting up SSO
* [ExampleResource](./src/resourceManagement/exampleResourceController.ts) - How to secure a reason creating access and updating it
* [Users](./src/users/usersController.ts) - Managing users for the whole account.## Details
### The middleware
The important part of the integration is to get the userId and Authress client to authorize the user. This is done by adding a middleware to parse out the caller, and one line in the service to validate this.