Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-oauth2-server

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-oauth2-server - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

lib/token.js

@@ -103,3 +103,3 @@ /**

var scheme = parts[0],
credentials = new Buffer(parts[1], 'base64').toString(),
credentials = new Buffer(parts[1], 'base64').toString().replace(/^\s+|\s+$/g, ""),
index = credentials.indexOf(':');

@@ -106,0 +106,0 @@

{
"name": "node-oauth2-server",
"description": "Complete, compliant and well tested module for implementing an OAuth2 Server/Provider with express in node.js",
"version": "1.3.0",
"version": "1.3.1",
"keywords": [

@@ -6,0 +6,0 @@ "oauth",

@@ -94,2 +94,49 @@ /**

});
it('should extract credentials from body', function (done) {
var app = bootstrap({
model: {
getClient: function (id, secret, callback) {
try {
id.should.equal('thom');
secret.should.equal('nightworld');
callback(false, false);
} catch (e) {
return done(e);
}
}
},
grants: ['password']
});
request(app)
.post('/oauth/token')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send({ grant_type: 'password', client_id: 'thom', client_secret: 'nightworld' })
.expect(400, done);
});
it('should extract credentials from header (Basic)', function (done) {
var app = bootstrap({
model: {
getClient: function (id, secret, callback) {
try {
id.should.equal('thom');
secret.should.equal('nightworld');
callback(false, false);
} catch (e) {
return done(e);
}
}
},
grants: ['password']
});
request(app)
.post('/oauth/token')
.set('Authorization', 'Basic dGhvbTpuaWdodHdvcmxkCg==')
.set('Content-Type', 'application/x-www-form-urlencoded')
.send({ grant_type: 'password' })
.expect(400, done);
});
});

@@ -102,5 +149,2 @@

getClient: function (id, secret, callback) {
id.should.equal('thom');
secret.should.equal('nightworld');
callback(false, false); // Fake invalid

@@ -107,0 +151,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc