keycloak-connect
Advanced tools
Comparing version 0.0.17 to 0.1.0
@@ -12,3 +12,3 @@ { | ||
"dependencies": { | ||
"keycloak-connect": "keycloak/keycloak-nodejs-connect", | ||
"keycloak-connect": "0.0.17", | ||
"hogan-express": "*", | ||
@@ -15,0 +15,0 @@ "express": "*", |
@@ -13,7 +13,15 @@ #Basic NodeJS Example | ||
Open the Keycloak admin console, click on Add Realm, click on 'Choose a JSON file', select nodejs-example-realm.json and click Upload. | ||
Open the Keycloak admin console, click on Add Realm, click on 'Choose a JSON file', | ||
select nodejs-example-realm.json and click Upload. | ||
Start NodeJS Example by running: | ||
Link the HEAD code of keycloak-connect by running: | ||
``` | ||
npm link ../ | ||
``` | ||
Install the dependencies and start NodeJS example by running: | ||
``` | ||
npm install | ||
npm start | ||
@@ -20,0 +28,0 @@ ``` |
@@ -22,3 +22,3 @@ function AdminLogout(keycloak, url) { | ||
return function(request, response, next) { | ||
return function adminLogout(request, response, next) { | ||
if ( request.url != url ) { | ||
@@ -25,0 +25,0 @@ return next(); |
module.exports = function(keycloak) { | ||
return function(request, response, next) { | ||
return function grantAttacher(request, response, next) { | ||
keycloak.getGrant( request, response ) | ||
@@ -5,0 +5,0 @@ .then( function(grant) { |
module.exports = function(keycloak, logoutUrl) { | ||
return function(request, response, next) { | ||
return function logout(request, response, next) { | ||
@@ -4,0 +4,0 @@ if ( request.url != logoutUrl ) { |
var URL = require('url'); | ||
module.exports = function(keycloak) { | ||
return function(request, response, next) { | ||
return function postAuth(request, response, next) { | ||
if ( ! request.query.auth_callback ) { | ||
@@ -6,0 +6,0 @@ return next(); |
@@ -19,10 +19,3 @@ var UUID = require('./../uuid' ); | ||
function simpleGuard(role,token) { | ||
if ( role.indexOf( "app:" ) === 0 ) { | ||
return token.hasApplicationRole( role.substring( 4 ) ); | ||
} | ||
if ( role.indexOf( "realm:" ) === 0 ) { | ||
return token.hasRealmRole( role.substring( 6 ) ); | ||
} | ||
return false; | ||
return token.hasRole(role); | ||
} | ||
@@ -40,3 +33,3 @@ | ||
return function(request, response, next) { | ||
return function protect(request, response, next) { | ||
if ( request.kauth && request.kauth.grant ) { | ||
@@ -43,0 +36,0 @@ if ( ! guard || guard( request.kauth.grant.access_token, request, response ) ) { |
module.exports = function(request, response, next) { | ||
module.exports = function setup(request, response, next) { | ||
request.kauth = {}; | ||
next(); | ||
}; |
{ | ||
"name": "keycloak-connect", | ||
"version": "0.0.17", | ||
"version": "0.1.0", | ||
"description": "Keycloak Connect Middleware", | ||
@@ -9,5 +9,20 @@ "homepage": "http://keycloak.org", | ||
"lint": "jshint *.js stores/*.js middleware/*.js", | ||
"prepublish": "./node_modules/nsp/bin/nsp check", | ||
"prepublish": "nsp check", | ||
"test": "node test/index.js" | ||
}, | ||
"keywords": [ | ||
"sso", | ||
"keycloak", | ||
"oauth", | ||
"oauth2.0", | ||
"authentication" | ||
], | ||
"files": [ | ||
"example", | ||
"middleware", | ||
"stores", | ||
"test", | ||
"index.js", | ||
"uuid.js" | ||
], | ||
"author": { | ||
@@ -19,3 +34,3 @@ "name": "Red Hat, Inc.", | ||
"dependencies": { | ||
"keycloak-auth-utils": "0.0.17", | ||
"keycloak-auth-utils": "0.1.0", | ||
"q": "^1.1.2" | ||
@@ -22,0 +37,0 @@ }, |
@@ -18,3 +18,3 @@ | ||
var store = function(request, response) { | ||
response.cookie( CookieStore.TOKEN_KEY, JSON.stringify( this ) ); | ||
response.cookie( CookieStore.TOKEN_KEY, this.__raw ); | ||
}; | ||
@@ -31,2 +31,2 @@ | ||
module.exports = CookieStore; | ||
module.exports = CookieStore; |
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
26681
19
645
30
2
+ Addedkeycloak-auth-utils@0.1.0(transitive)
- Removedkeycloak-auth-utils@0.0.17(transitive)
Updatedkeycloak-auth-utils@0.1.0