diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 000000000..c2fa5cc8a --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +oauth2-server-restify \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 000000000..d82104827 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 000000000..e93b6b161 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/oauth2_server_restify_node_modules.xml b/.idea/libraries/oauth2_server_restify_node_modules.xml new file mode 100644 index 000000000..e3618cc3c --- /dev/null +++ b/.idea/libraries/oauth2_server_restify_node_modules.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..8662aa97f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..380925dca --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/oauth2-server-restify.iml b/.idea/oauth2-server-restify.iml new file mode 100644 index 000000000..7b4a771d3 --- /dev/null +++ b/.idea/oauth2-server-restify.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 000000000..922003b84 --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..4ad986dbf --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1414655818974 + + + 1414659666566 + + + 1414663418066 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/mongodb/Readme.md b/examples/mongodb/Readme.md old mode 100755 new mode 100644 diff --git a/examples/mongodb/model.js b/examples/mongodb/model.js old mode 100755 new mode 100644 diff --git a/lib/grant.js b/lib/grant.js index 6ad6c3046..cc76e5fbb 100644 --- a/lib/grant.js +++ b/lib/grant.js @@ -64,8 +64,7 @@ function Grant (config, req, res, next) { */ function extractCredentials (next) { // Only POST via application/x-www-form-urlencoded is acceptable - if (this.req.method !== 'POST' || - !this.req.is('application/x-www-form-urlencoded')) { + if (this.req.method !== 'POST' || !this.req.is('application/x-www-form-urlencoded')) { return next(new error.BadMethodError('Method must be POST with application/x-www-form-urlencoded encoding')); } @@ -78,6 +77,8 @@ function extractCredentials (next) { // Extract credentials // http://tools.ietf.org/html/rfc6749#section-3.2.1 this.client = credsFromBasic(this.req) || credsFromBody(this.req); + console.log(this.client); + if (!this.client.clientId || !this.client.clientId.match(this.config.regex.clientId)) { return next(new error.InvalidCredentialsError('Invalid or missing client_id parameter')); diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..95e625b8b --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,57 @@ +0 info it worked if it ends with ok +1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish' ] +2 info using npm@1.4.28 +3 info using node@v0.10.32 +4 verbose publish [ '.' ] +5 verbose cache add [ '.', null ] +6 verbose cache add name=undefined spec="." args=[".",null] +7 verbose parsed url { protocol: null, +7 verbose parsed url slashes: null, +7 verbose parsed url auth: null, +7 verbose parsed url host: null, +7 verbose parsed url port: null, +7 verbose parsed url hostname: null, +7 verbose parsed url hash: null, +7 verbose parsed url search: null, +7 verbose parsed url query: null, +7 verbose parsed url pathname: '.', +7 verbose parsed url path: '.', +7 verbose parsed url href: '.' } +8 silly lockFile 3a52ce78- . +9 verbose lock . /Users/marsanla/.npm/3a52ce78-.lock +10 verbose tar pack [ '/Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz', +10 verbose tar pack '.' ] +11 verbose tarball /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz +12 verbose folder . +13 info prepublish oauth2-server-restify@2.3.0 +14 silly lockFile 1f1177db-tar tar://. +15 verbose lock tar://. /Users/marsanla/.npm/1f1177db-tar.lock +16 silly lockFile d23e35c7-server-restify-2-3-0-package-tgz tar:///Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz +17 verbose lock tar:///Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz /Users/marsanla/.npm/d23e35c7-server-restify-2-3-0-package-tgz.lock +18 silly lockFile 1f1177db-tar tar://. +19 silly lockFile 1f1177db-tar tar://. +20 silly lockFile d23e35c7-server-restify-2-3-0-package-tgz tar:///Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz +21 silly lockFile d23e35c7-server-restify-2-3-0-package-tgz tar:///Users/marsanla/.npm/oauth2-server-restify/2.3.0/package.tgz +22 silly lockFile e9adc364-th2-server-restify-2-3-0-package /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package +23 verbose lock /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package /Users/marsanla/.npm/e9adc364-th2-server-restify-2-3-0-package.lock +24 silly lockFile e9adc364-th2-server-restify-2-3-0-package /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package +25 silly lockFile e9adc364-th2-server-restify-2-3-0-package /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package +26 silly lockFile 3a52ce78- . +27 silly lockFile 3a52ce78- . +28 error addLocal Could not install . +29 error Error: EACCES, open '/Users/marsanla/.npm/oauth2-server-restify/2.3.0/package/package.json' +29 error { [Error: EACCES, open '/Users/marsanla/.npm/oauth2-server-restify/2.3.0/package/package.json'] +29 error errno: 3, +29 error code: 'EACCES', +29 error path: '/Users/marsanla/.npm/oauth2-server-restify/2.3.0/package/package.json' } +30 error Please try running this command again as root/Administrator. +31 error System Darwin 14.0.0 +32 error command "node" "/usr/local/bin/npm" "publish" +33 error cwd /Users/marsanla/Proyectos/elefrant/components/elefrant-oauth2/node_modules/oauth2-server-restify +34 error node -v v0.10.32 +35 error npm -v 1.4.28 +36 error path /Users/marsanla/.npm/oauth2-server-restify/2.3.0/package/package.json +37 error code EACCES +38 error errno 3 +39 error stack Error: EACCES, open '/Users/marsanla/.npm/oauth2-server-restify/2.3.0/package/package.json' +40 verbose exit [ 3, true ] diff --git a/package.json b/package.json index 61d55e5e0..ee32ebab2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ ], "main": "lib/oauth2server.js", "dependencies": { + "node-oauth2-server-restify": "git+https://github.com/marsanla/node-oauth2-server-restify.git", "basic-auth": "~0.0.1", "node-restify-errors": "~0.1.0" },