Skip to content

Commit

Permalink
add missing links
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed May 9, 2024
1 parent eb4f4bb commit d84b64e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/pages/examples/authorization-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This grant type is defined in [RFC 6749 section 1.3.1](https://datatracker.ietf.

## Create authorization URL

Use [`AuthorizationCodeAuthorizationURL`]() to represent a new authorization URL. You can use [`generateState()`]() to generate a new state (make sure the state is different on each request).
Use [`AuthorizationCodeAuthorizationURL`](/reference/main/AuthorizationCodeAuthorizationURL) to represent a new authorization URL. You can use [`generateState()`](/reference/main/generateState) to generate a new state (make sure the state is different on each request).

```ts
import { AuthorizationCodeAuthorizationURL, generateState } from "@oslojs/oauth2";
Expand Down Expand Up @@ -36,9 +36,9 @@ url.appendScopes("profile");

## Validation authorization code

Create a new [`AuthorizationCodeAccessTokenRequestContext`]() and send an access token request with [`sendTokenRequest()`]().
Create a new [`AuthorizationCodeAccessTokenRequestContext`](/reference/main/AuthorizationCodeAccessTokenRequestContext) and send an access token request with [`sendTokenRequest()`](/reference/main/sendTokenRequest).

[`sendTokenRequest()`]() throws an [`OAuth2RequestError`]() when the endpoint returns a known OAuth 2.0 error response.
This throws an [`OAuth2RequestError`](/reference/main/OAuth2RequestError) when the endpoint returns a known OAuth 2.0 error response.

```ts
import {
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/examples/device-authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This grant type is defined in [RFC 8628](https://datatracker.ietf.org/doc/html/r

## Device authorization

Create a new [`DeviceAuthorizationRequestContext`]() and send an access token request to the authorization endpoint with [`sendDeviceAuthorizationRequest()`](). This throws an [`OAuth2RequestError`]() when the endpoint returns a known OAuth 2.0 error response.
Create a new [`DeviceAuthorizationRequestContext`](/reference/main/DeviceAuthorizationRequestContext) and send an access token request to the authorization endpoint with [`sendDeviceAuthorizationRequest()`](/reference/main/sendDeviceAuthorizationRequest). This throws an [`OAuth2RequestError`](/reference/main/OAuth2RequestError) when the endpoint returns a known OAuth 2.0 error response.

```ts
import {
Expand Down Expand Up @@ -50,7 +50,7 @@ url.appendScopes("profile");

## Validate device code

Create a new [`DeviceAccessTokenRequestContext`]() and send an access token request to the token endpoint with [`sendTokenRequest()`](). The request should be sent repeatedly on a set interval until the endpoint returns a successful response or the code expires. The function throws an [`OAuth2RequestError`]() when the endpoint returns a known OAuth 2.0 error response.
Create a new [`DeviceAccessTokenRequestContext`](/reference/main/DeviceAccessTokenRequestContext) and send an access token request to the token endpoint with [`sendTokenRequest()`](/reference/main/sendTokenRequest). The request should be sent repeatedly on a set interval until the endpoint returns a successful response or the code expires. The function throws an [`OAuth2RequestError`](/reference/main/OAuth2RequestError) when the endpoint returns a known OAuth 2.0 error response.

The authentication methods for `DeviceAccessTokenRequestContext` are the same as `DeviceAuthorizationRequestContext` mentioned above.

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/examples/pkce.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ title: "PKCE"

# PKCE

This extension is defined in [RFC 7639](hhttps://datatracker.ietf.org/doc/html/rfc7636). See the [Authorization code grant type]() example page for the basic authorization code grant type.
This extension is defined in [RFC 7639](hhttps://datatracker.ietf.org/doc/html/rfc7636). See the [Authorization code grant type](/examples/authorization-code) example page for the basic authorization code grant type.

## Authorization URL

Use [`generateCodeVerifier()`]() to generate a new code verifier and set a code challenge with either [`setS256CodeChallenge()`]() or [`setPlainCodeChallenge()`](). Make sure the code verifier is different on each request.
Use [`generateCodeVerifier()`](/reference/main/generateCodeVerifier) to generate a new code verifier and set a code challenge with either [`setS256CodeChallenge()`](/reference/main/setS256CodeChallenge) or [`setPlainCodeChallenge()`](/reference/main/setPlainCodeChallenge). Make sure the code verifier is different on each request.

```ts
import { AuthorizationCodeAuthorizationURL, generateCodeVerifier } from "@oslojs/oauth2";
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/examples/refresh-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Refresh tokens"

This is defined in [RFC 6749 section 6](https://datatracker.ietf.org/doc/html/rfc6749#section-6).

Create a new [`RefreshRequestContext`]() and send a refresh request to the token endpoint with [`sendTokenRequest()`](). This throws an [`OAuth2RequestError`]() when the endpoint returns a known OAuth 2.0 error response.
Create a new [`RefreshRequestContext`](/reference/main/RefreshRequestContext) and send a refresh request to the token endpoint with [`sendTokenRequest()`](/reference/main/sendTokenRequest). This throws an [`OAuth2RequestError`](/reference/main/OAuth2RequestError) when the endpoint returns a known OAuth 2.0 error response.

```ts
import { RefreshRequestContext, sendTokenRequest, OAuth2RequestError } from "@oslojs/oauth2";
Expand Down
4 changes: 1 addition & 3 deletions docs/pages/examples/token-revocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ title: "Token revocation"

This is defined is [RFC 7009](https://datatracker.ietf.org/doc/html/rfc7009).

Create a new [`TokenRevocationRequestContext`]() and send a revocation request to the token endpoint with [`sendTokenRevocationRequest()`]().

[`sendTokenRequest()`]() throws an [`OAuth2RequestError`]() when the endpoint returns a known OAuth 2.0 error response.
Create a new [`TokenRevocationRequestContext`](/reference/main/TokenRevocationRequestContext) and send a revocation request to the token endpoint with [`sendTokenRevocationRequest()`](/reference/main/sendTokenRevocationRequest). This throws an [`OAuth2RequestError`](/reference/main/OAuth2RequestError) when the endpoint returns a known OAuth 2.0 error response.

```ts
import {
Expand Down

0 comments on commit d84b64e

Please sign in to comment.