Skip to content

Commit

Permalink
docs: improve /revoke and /introspect docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonraimondi committed Aug 10, 2024
1 parent 3aa2956 commit adcead9
Show file tree
Hide file tree
Showing 6 changed files with 1,422 additions and 1,416 deletions.
4 changes: 4 additions & 0 deletions docs/docs/endpoints/introspect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ title: /token/introspect

The `/token/introspect` endpoint is a back channel endpoint that revokes an existing token. The introspect endpoint requires the `TokenRepository#getByAccessToken` method to introspect `token_type_hint=access_token`.

:::tip
This endpoint requires `TokenRepository#getByAccessToken` to be defined
:::

```ts
app.post("/token/introspect", async (req: Express.Request, res: Express.Response) => {
try {
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/endpoints/revoke.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ title: /token/revoke

The `/token/revoke` endpoint is a back channel endpoint that revokes an existing token.

:::tip
This endpoint requires `TokenRepository#getByAccessToken` to be defined
:::

```ts
app.post("/token/revoke", async (req: Express.Request, res: Express.Response) => {
try {
Expand Down
7 changes: 7 additions & 0 deletions docs/docs/getting_started/repositories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ interface OAuthTokenRepository {

// Fetch refresh token entity from storage by refresh token
getByRefreshToken(refreshTokenToken: string): Promise<OAuthToken>;

// (Optional)
// Required if using /revoke RFC7009 "OAuth 2.0 Token Revocation"
// Required if using /introspect RFC7662 "OAuth 2.0 Token Introspection"
// @see https://tsoauth2server.com/docs/getting_started/endpoints#the-introspect-endpoint
// @see https://tsoauth2server.com/docs/getting_started/endpoints#the-revoke-endpoint
getByAccessToken?(accessTokenToken: string): Promise<OAuthToken>;
}
```

Expand Down
24 changes: 12 additions & 12 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@jmondi/github-ui": "^0.2.8",
"@docusaurus/core": "3.5.1",
"@docusaurus/preset-classic": "3.5.1",
"@jmondi/github-ui": "^1.0.1",
"@mdx-js/react": "^3.0.1",
"clsx": "^2.1.1",
"lucide-react": "^0.400.0",
"lucide-react": "^0.427.0",
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.4.0",
"@docusaurus/tsconfig": "3.4.0",
"@docusaurus/types": "3.4.0",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"prettier": "^3.3.2",
"tailwindcss": "^3.4.4",
"typescript": "~5.5.3"
"@docusaurus/module-type-aliases": "3.5.1",
"@docusaurus/tsconfig": "3.5.1",
"@docusaurus/types": "3.5.1",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.9",
"typescript": "~5.5.4"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit adcead9

Please sign in to comment.