Skip to content

Commit

Permalink
chore(docs): add adapters list to root readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed Sep 12, 2021
1 parent 9fed31a commit b9c916a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ The following RFCs are implemented:
- [RFC7519 “JSON Web Token (JWT)”](https://tools.ietf.org/html/rfc7519)
- [RFC7636 “Proof Key for Code Exchange by OAuth Public Clients”](https://tools.ietf.org/html/rfc7636)

Adapters are included for the following frameworks:

- [Express](https://expressjs.com)
- [Fastify](https://fastify.io)

## Getting Started

Save some eye strain, **use the [documentation site](https://jasonraimondi.github.io/ts-oauth2-server/)**
Expand Down Expand Up @@ -135,9 +140,15 @@ const authorizationServer = new AuthorizationServer(
userRepository,
new JwtService("secret-key"),
);
authorizationServer.enableGrantType("client_credentials");
authorizationServer.enableGrantType("authorization_code");
authorizationServer.enableGrantType("refresh_token");

// Enable as many or as few grants as you'd like.
// You can pass in an optional tuple of [GrantType, DateInterval]
// to set Access Token TTL per grant type.
authorizationServer.enableGrantTypes(
["client_credentials", new DateInterval("1d")],
["authorization_code", new DateInterval("15m")],
"refresh_token",
);
authorizationServer.enableGrantType("implicit"); // implicit grant is not recommended
authorizationServer.enableGrantType("password"); // password grant is not recommended
```
Expand Down

0 comments on commit b9c916a

Please sign in to comment.