Socket
Socket
Sign inDemoInstall

keycloak-connect

Package Overview
Dependencies
74
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.17 to 0.1.0

2

example/package.json

@@ -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;
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc