passport-bitbucket-token
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "passport-bitbucket-token", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Passport strategy for authenticating with Bitbucket access tokens using the OAuth 2.0 API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# passport-bitbucket-token | ||
Passport strategy for authenticating with Bitbucket access tokens using the OAuth 2.0 API. | ||
![License](https://img.shields.io/badge/license-MIT-blue.svg) | ||
[Passport](http://passportjs.org/) strategy for authenticating with [Bitbucket](https://bitbucket.org/) access tokens using the OAuth 2.0 API. | ||
Library is inspired by [passport-facebook-token](https://github.com/drudge/passport-facebook-token). | ||
## Installation | ||
`npm install passport-bitbucket-token` | ||
## Usage | ||
### Configure Strategy | ||
```js | ||
var BitbucketTokenStrategy = require('passport-bitbucket-token'); | ||
passport.use(new BitbucketTokenStrategy({ | ||
clientID: 'app-id', | ||
clientSecret: 'client-secret' | ||
}, | ||
function (accessToken, refreshToken, profile, done) { | ||
User.upsertUser(accessToken, refreshToken, profile, function(err, user) { | ||
return done(err, user); | ||
}); | ||
})); | ||
``` | ||
### Authenticate User | ||
```js | ||
router.route('/auth/bitbucket') | ||
.post(passport.authenticate('bitbucket-token'), function(req, res, next) { | ||
if (!req.user) { | ||
return res.send(401, 'User Not Authenticated'); | ||
} | ||
res.send(200); | ||
}); | ||
``` | ||
# License | ||
passport-bitbucket-token is released under [MIT License](https://opensource.org/licenses/MIT). | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81738
48
1