authplaneProvider wires authentication through Authplane, so your tools receive a signed-in user.
Example
server.ts
Signature
Parameters
opts
-
issueris the authorization server’s issuer identifier, for examplehttps://auth.acme.com. -
resourceis this server’s resource identifier: the public URL clients reach, advertised in its protected-resource metadata. Required, unlike the other providers — see below. -
audienceoverrides the expectedaud, which defaults toresource. Set it only when the resource is configured in Authplane with an explicit audience override.
CustomProviderOptions options: serverUrl, scopes, requiredScopes, and metadataOverrides.
Dynamic Client Registration is supported natively, so clients register directly with Authplane and this server stays out of the authorization path.
Why resource is required
Authplane binds the access token’s aud to the RFC 8707 resource indicator the client sends, and the client reads that value from the resource field of this server’s protected-resource metadata. Setting resource gives the deployment one fixed identifier for both, so it is required rather than optional.
Three values must therefore be identical, and OAuth compares identifiers by exact string match:
- the value this server advertises as its
resourcemetadata; - the resource registered in Authplane;
- the
audAuthplane mints, which it takes from (2).
invalid_target, before any token exists; between 1 and 3, token verification fails. Register resource in Authplane character for character and all three agree.
Pathless origins
The advertised resource is the URL-normalised form ofresource, so a bare origin is advertised with a root path: https://acme.example.com is advertised as https://acme.example.com/. The provider asks for the advertised form up front, and names it if the two differ:
Returns
APromise for the OAuthConfig you pass to the oauth constructor option.
Connect an Identity Provider
Set up sign-in with a hosted provider
Authenticate Users
Add sign-in to your app end to end
customProvider
Wire OAuth from any IdP’s discovery document