Optional
cookieThe name of the cookie used to keep state and code verifier around.
The OAuth2 flow requires generating a random state and code verifier, and then checking that the state matches when the user is redirected back to the application. This is done to prevent CSRF attacks.
The state and code verifier are stored in a cookie, and this option allows you to customize the name of that cookie if needed.
Optional
fetchA custom fetch implementation to use when making requests to the OAuth2 server. This can be useful when you need to replace the default fetch to use a proxy, for example.
The issuer of the OpenAuth server you want to use. This is where your OpenAuth server is hosted.
Optional
providerThe identity provider already configured in your OpenAuth server you want to send the user to.
This can't be changed after the strategy is created, if you have more than one provider create multiple instances of your strategy.
authenticator.use(
new OpenAuthStrategy(
{
redirectURI,
clientID,
issuer,
provider: "google" // Set it to Google
},
verify
),
"google" // Rename the strategy to Google
)
authenticator.use(
new OpenAuthStrategy(
{
redirectURI,
clientID,
issuer,
provider: "github" // Set it to GitHub
},
verify
),
"github" // Rename the strategy to GitHub
)
The redirect URI of the application you registered in the OpenAuth server.
This is where the user will be redirected after they authenticate.
The client ID of the application you registered in the OpenAuth server.