Skip to content

Instantly share code, notes, and snippets.

@hedleysmith
Created March 16, 2016 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hedleysmith/8088373ca9dcf31e472f to your computer and use it in GitHub Desktop.
Save hedleysmith/8088373ca9dcf31e472f to your computer and use it in GitHub Desktop.
Anvil Connect: Node client basic re-usable config
const configureAnvil = function() {
return anvil.discover()
.then(function (configuration) {
return anvil.getJWKs();
},
function(err) {
console.log(err);
})
.then(function (jwks) {
// To redirect to the registration page instead of signup page use this:
// return anvil.authorizationUri({
// endpoint: 'signup'
// });
return anvil.authorizationUri();
},
function(err) {
console.log(err);
});
};
// Elsewhere in your app...
configureAnvil()
.then(function (uri) {
res.redirect(uri);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment