You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting_started/README.md
+47-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,53 @@ yarn add @jmondi/oauth2-server
18
18
</code-block>
19
19
</code-group>
20
20
21
-
### Getting Started
21
+
## The Authorization Server
22
+
23
+
The AuthorizationServer depends on [the repositories](#repositories). By default, no grants are enabled; each grant is opt-in and must be enabled when creating the AuthorizationServer.
24
+
25
+
You can enable any grant types you would like to support.
Copy file name to clipboardExpand all lines: docs/grants/authorization_code.md
+35-5
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,27 @@ Pragma: no-cache
102
102
```
103
103
:::
104
104
105
-
### Code Verifier
105
+
### PKCE
106
+
107
+
PKCE ([RFC 7636](https://tools.ietf.org/html/rfc7636)) is an extension to the [Authorization Code flow](https://oauth.net/2/grant-types/authorization-code/) to prevent several attacks and to be able to securely perform the OAuth exchange from public clients.
108
+
109
+
By default, PKCE is enabled and encouraged for all users. If you need to support a legacy client system without PKCE, you can disable PKCE with the authorization server:
110
+
111
+
```
112
+
const authorizationServer = new AuthorizationServer(
113
+
authCodeRepository,
114
+
clientRepository,
115
+
accessTokenRepository,
116
+
scopeRepository,
117
+
userRepository,
118
+
new JwtService("secret-key"),
119
+
{
120
+
requiresPKCE: false,
121
+
}
122
+
);
123
+
```
124
+
125
+
#### Code Verifier
106
126
107
127
The `code_verifier` is part of the extended [“PKCE”](https://tools.ietf.org/html/rfc7636) and helps mitigate the threat of having authorization codes intercepted.
108
128
@@ -116,10 +136,20 @@ import crypto from "crypto";
0 commit comments