keycloak-auth-utils
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -124,4 +124,11 @@ /*! | ||
this.publicKey += "-----END PUBLIC KEY-----\n"; | ||
/** | ||
* If this is a Bearer Only application. | ||
* @type {Boolean} | ||
*/ | ||
this.bearerOnly = config['bearer-only'] || config.bearerOnly || false; | ||
}; | ||
module.exports = Config; |
@@ -25,2 +25,3 @@ /*! | ||
var crypto = require('crypto'); | ||
var querystring = require('querystring'); | ||
@@ -131,12 +132,17 @@ var Form = require('./form'); | ||
console.log( "request.session", request.session ); | ||
var redirectUri = encodeURIComponent( request.session.auth_redirect_uri ); | ||
var queryObj = { | ||
application_session_state: sessionId, | ||
application_session_host: sessionHost, | ||
code: code, | ||
grant_type: 'authorization_code', | ||
client_id: this.clientId, | ||
redirect_uri: request.session.auth_redirect_uri | ||
}; | ||
var params = querystring.stringify(queryObj); | ||
var params = 'code=' + code + '&application_session_state=' + sessionId + '&redirect_uri=' + redirectUri + '&application_session_host=' + sessionHost; | ||
var options = URL.parse( this.realmUrl + '/tokens/access/codes' ); | ||
var options = URL.parse( this.realmUrl + '/protocol/openid-connect/token' ); | ||
var protocol = http; | ||
options.method = 'POST'; | ||
if ( options.protocol == 'https:' ) { | ||
if ( options.protocol == 'https:' ) { | ||
protocol = https; | ||
@@ -147,7 +153,6 @@ } else { | ||
options.headers = { | ||
options.headers = { | ||
'Content-Length': params.length, | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
'Authorization': 'Basic ' + new Buffer( this.clientId + ':' + this.secret ).toString('base64' ), | ||
}; | ||
'Content-Type': 'application/x-www-form-urlencoded' | ||
}; | ||
@@ -316,3 +321,5 @@ var request = protocol.request( options, function(response) { | ||
var grantData = JSON.parse( rawData ); | ||
var grantData = rawData; | ||
if (typeof rawData !== 'object') | ||
grantData = JSON.parse( grantData ); | ||
@@ -319,0 +326,0 @@ var access_token; |
{ | ||
"name": "keycloak-auth-utils", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "General Keycloak Utilities", | ||
"homepage": "http://keycloak.org", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node_modules/jasmine/bin/jasmine.js", | ||
"prepublish": "./node_modules/nsp/bin/nsp check", | ||
"build": "node_modules/grunt-cli/bin/grunt" | ||
}, | ||
"author": "", | ||
"author": { | ||
"name": "Red Hat, Inc.", | ||
"url": "http://keycloak.org" | ||
}, | ||
"license": "Apache-2.0", | ||
@@ -21,3 +26,4 @@ "devDependencies": { | ||
"grunt-touch": "^0.1.0", | ||
"jasmine": "^2.1.1" | ||
"jasmine": "^2.1.1", | ||
"nsp": "*" | ||
}, | ||
@@ -24,0 +30,0 @@ "dependencies": { |
@@ -11,3 +11,3 @@ | ||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; | ||
var config = new Config(); | ||
var config = new Config('spec/keycloak.json'); | ||
manager = new GrantManager(config); | ||
@@ -71,3 +71,3 @@ }) | ||
}) | ||
it( 'should be able to validate a valid token string', function(done) { | ||
@@ -100,4 +100,4 @@ var originalAccessToken; | ||
}) | ||
}); |
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
41102
14
874
2
1
10
3