Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

dynastic/accounts-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@dynastic-accounts/provider

A Passport OAuth2 strategy for easily authenticating users with Dynastic Accounts.

Installation

  • npm install --save @dynastic-accounts/provider
  • It's that simple!

Example usage

Authorization

passport.use(new DynasticStrategy({
        clientID: "123-456-789",
        clientSecret: "shhh-its-a-secret",
        scopes: ["user"],
        callbackURL: "https://www.example.net/auth/dynastic/callback",
        firstParty: true // Skip consent
    },
    (accessToken, refreshToken, profile, cb) => {
        User.findOrCreate(..., (err, user) => {
            cb(err, user);
        });
    }
));

router.get('/dynastic', passport.authenticate("dynastic", { state: "auth" }));
router.get("/dynastic/callback", passport.authenticate("dynastic", { failureRedirect: "/auth-fail" }));

Advanced Options

  • Set options.apiBaseURL and options.frontendBaseURL to control which servers the requests are made against.
  • To completely change the URL, set options.authorizationURL and options.tokenURL when creating the strategy.

About

A Passport OAuth2 strategy for easily authenticating users with Dynastic Accounts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published