Skip to main content

OAuth

SDK methods for the OAuth module, accessed via soat.oauth. See the OAuth module docs for permissions and data model, and each method's REST page for the full request/response schema.

soat.oauth.getOauthAuthorizationServerMetadata()

Get authorization server metadata

  • Method: GET
  • Path: /.well-known/oauth-authorization-server
await soat.oauth.getOauthAuthorizationServerMetadata();

Request & response schema

soat.oauth.getOauthProtectedResourceMetadata()

Get protected resource metadata

  • Method: GET
  • Path: /.well-known/oauth-protected-resource
await soat.oauth.getOauthProtectedResourceMetadata();

Request & response schema

soat.oauth.registerOauthClient()

Register an OAuth client

  • Method: POST
  • Path: /register
await soat.oauth.registerOauthClient({
body: { redirect_uris, /* + optional */ },
});

Request & response schema

soat.oauth.authorizeOauthClient()

Start the authorization code flow

  • Method: GET
  • Path: /authorize
await soat.oauth.authorizeOauthClient({
query: { client_id, redirect_uri, response_type, code_challenge, code_challenge_method, /* + optional */ },
});

Request & response schema

soat.oauth.createOauthToken()

Exchange a code or refresh token for an access token

  • Method: POST
  • Path: /token
await soat.oauth.createOauthToken({
body: { grant_type, /* + optional */ },
});

Request & response schema