Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit 314f8d2546a82daf56832c26dabac096cede3363 @jaredhanson jaredhanson committed Oct 30, 2011
Showing with 177 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +8 −0 .npmignore
  3. +20 −0 LICENSE
  4. +19 −0 Makefile
  5. +31 −0 README.md
  6. +15 −0 lib/passport-linkedin/index.js
  7. +28 −0 lib/passport-linkedin/strategy.js
  8. +16 −0 package.json
  9. +15 −0 test/index-test.js
  10. +23 −0 test/strategy-test.js
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules
@@ -0,0 +1,8 @@
+*.md
+.DS_Store
+.git*
+Makefile
+docs/
+examples/
+support/
+test/
20 LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2011 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
+NODE = node
+TEST = vows
+TESTS ?= test/*-test.js
+
+test:
+ @NODE_ENV=test NODE_PATH=lib $(TEST) $(TEST_FLAGS) $(TESTS)
+
+docs: docs/api.html
+
+docs/api.html: lib/passport-linkedin/*.js
+ dox \
+ --title Passport-LinkedIn \
+ --desc "LinkedIn authentication strategy for Passport" \
+ $(shell find lib/passport-linkedin/* -type f) > $@
+
+docclean:
+ rm -f docs/*.{1,html}
+
+.PHONY: test docs docclean
@@ -0,0 +1,31 @@
+# Passport-LinkedIn
+
+[Passport](https://github.com/jaredhanson/passport) strategy for authenticating
+with [LinkedIn](http://www.linkedin.com/) using the OAuth 1.0a API.
+
+## Credits
+
+ - [Jared Hanson](http://github.com/jaredhanson)
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,15 @@
+/**
+ * Module dependencies.
+ */
+var Strategy = require('./strategy');
+
+
+/**
+ * Framework version.
+ */
+exports.version = '0.1.0';
+
+/**
+ * Expose constructors.
+ */
+exports.Strategy = Strategy;
@@ -0,0 +1,28 @@
+/**
+ * Module dependencies.
+ */
+var util = require('util')
+ , OAuthStrategy = require('passport-oauth').OAuthStrategy;
+
+
+function Strategy(options, verify) {
+ options = options || {};
+ options.requestTokenURL = options.requestTokenURL || 'https://api.linkedin.com/uas/oauth/requestToken';
+ options.accessTokenURL = options.accessTokenURL || 'https://api.linkedin.com/uas/oauth/accessToken';
+ options.userAuthorizationURL = options.userAuthorizationURL || 'https://www.linkedin.com/uas/oauth/authenticate';
+ options.sessionKey = options.sessionKey || 'oauth:linkedin';
+
+ OAuthStrategy.call(this, options, verify);
+ this.name = 'linkedin';
+}
+
+/**
+ * Inherit from `OAuthStrategy`.
+ */
+util.inherits(Strategy, OAuthStrategy);
+
+
+/**
+ * Expose `Strategy`.
+ */
+module.exports = Strategy;
@@ -0,0 +1,16 @@
+{
+ "name": "passport-linkedin",
+ "version": "0.1.0",
+ "description": "LinkedIn authentication strategy for Passport.",
+ "author": "Jared Hanson <jaredhanson@gmail.com> (http://www.jaredhanson.net/)",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/jaredhanson/passport-linkedin.git"
+ },
+ "main": "./lib/passport-linkedin",
+ "dependencies": {
+ "passport-oauth": ">= 0.1.0"
+ },
+ "engines": { "node": ">= 0.4.0" },
+ "keywords": ["passport", "linkedin", "auth", "authn", "authentication", "identity"]
+}
@@ -0,0 +1,15 @@
+var vows = require('vows');
+var assert = require('assert');
+var util = require('util');
+var linkedin = require('passport-linkedin');
+
+
+vows.describe('passport-linkedin').addBatch({
+
+ 'module': {
+ 'should report a version': function (x) {
+ assert.isString(linkedin.version);
+ },
+ },
+
+}).export(module);
@@ -0,0 +1,23 @@
+var vows = require('vows');
+var assert = require('assert');
+var util = require('util');
+var LinkedInStrategy = require('passport-linkedin/strategy');
+
+
+vows.describe('LinkedInStrategy').addBatch({
+
+ 'strategy': {
+ topic: function() {
+ return new LinkedInStrategy({
+ consumerKey: 'ABC123',
+ consumerSecret: 'secret'
+ },
+ function() {});
+ },
+
+ 'should be named linkedin': function (strategy) {
+ assert.equal(strategy.name, 'linkedin');
+ },
+ },
+
+}).export(module);

0 comments on commit 314f8d2

Please sign in to comment.