Package Exports
- @zapscloud/zapsauth
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@zapscloud/zapsauth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
zapsauth-node
Zapscloud Auth Package
Initialize Library with config values
var _zapsauth = new ZapsAuth({
url: 'https://api.zapscloud.com',
app: 'appname',
authkey: ' ',
authsecret: ' '
})Snippet for oAuth2 Token Service
Handling grant types (password / refresh_token / client_authentication)
app.post('/auth', (req,res) => {
return _zapsauth.tokenService (req, res);
});Snippet for oAuth2 Token Validation Service
function validation(req, res, next){
return _zapsauth.validationService (req, res, next);
}
app.get('/main',validation,(req,res) => {
res.end('Successful');
});