Skip to content

OidcProvider

Reference doc for the `OidcProvider`.

Use this to connect authentication providers that support OIDC.

import { OidcProvider } from "@openauthjs/openauth/provider/oidc"
export default issuer({
providers: {
oauth2: OidcProvider({
clientId: "1234567890",
issuer: "https://auth.myserver.com"
})
}
})

Methods

OidcProvider

OidcProvider(config)

Parameters

Returns Provider

OidcConfig

OidcConfig.clientID

Type string

The client ID.

This is just a string to identify your app.

{
clientID: "my-client"
}

OidcConfig.issuer

Type string

The URL of your authorization server.

{
issuer: "https://auth.myserver.com"
}

OidcConfig.query?

Type Record<string, string>

Any additional parameters that you want to pass to the authorization endpoint.

{
query: {
prompt: "consent"
}
}

OidcConfig.scopes?

Type string[]

A list of OIDC scopes that you want to request.

{
scopes: ["openid", "profile", "email"]
}