loopback-component-oauth2
Advanced tools
Comparing version 2.0.0-beta1 to 2.0.0-beta2
@@ -0,4 +1,14 @@ | ||
2015-01-07, Version 2.0.0-beta2 | ||
=============================== | ||
* Allow declarative config of OAuth2 component (Miroslav Bajtoš) | ||
* Fix bad CLA URL in CONTRIBUTING.md (Ryan Graham) | ||
2014-12-17, Version 2.0.0-beta1 | ||
=============================== | ||
* v2.0.0-beta1 (Raymond Feng) | ||
* Update deps (Raymond Feng) | ||
@@ -158,6 +168,2 @@ | ||
2014-01-05, Version 1.0.1 | ||
========================= | ||
* Bump version to 1.0.1. (Jared Hanson) | ||
@@ -175,6 +181,2 @@ | ||
2013-09-24, Version 1.0.0 | ||
========================= | ||
* Bump version to 1.0.0. (Jared Hanson) | ||
@@ -346,4 +348,2 @@ | ||
* Update support files. (Jared Hanson) | ||
* Port authorizationCode exchange test cases to Mocha. (Jared Hanson) | ||
@@ -350,0 +350,0 @@ |
@@ -17,3 +17,3 @@ ### Contributing ### | ||
* Sign the [Contributor License Agreement](https://cla.strongloop.com/strongloop/loopback-component-oauth2) | ||
* Sign the [Contributor License Agreement](https://cla.strongloop.com/agreements/strongloop/loopback-component-oauth2) | ||
@@ -20,0 +20,0 @@ * Submit a pull request through Github. |
@@ -8,2 +8,25 @@ /** | ||
exports.oAuth2Provider = loopbackOAuth2; // Keep backward-compatibility | ||
exports.oauth2orize = require('./oauth2orize'); | ||
exports.oauth2orize = require('./oauth2orize'); | ||
/** | ||
* A factory function for middleware handler that obtains the `authentication` | ||
* handler configured by the OAuth2 component. | ||
*/ | ||
exports.authenticate = function(options) { | ||
var handler; | ||
return function oauth2AuthenticateHandler(req, res, next) { | ||
if (!handler) { | ||
var app = req.app; | ||
var authenticate = app._oauth2Handlers && app._oauth2Handlers.authenticate; | ||
if (!authenticate) { | ||
return next(new Error( | ||
'The OAuth2 component was not configured for this application.')); | ||
} | ||
handler = authenticate(options); | ||
} | ||
return handler(req, res, next); | ||
}; | ||
} |
@@ -752,3 +752,5 @@ /** | ||
app._oauth2Handlers = handlers; | ||
return handlers; | ||
}; |
{ | ||
"name": "loopback-component-oauth2", | ||
"version": "2.0.0-beta1", | ||
"version": "2.0.0-beta2", | ||
"description": "OAuth 2.0 provider for LoopBack", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
436535
3389
1