Socket
Socket
Sign inDemoInstall

keycloak-connect

Package Overview
Dependencies
73
Maintainers
4
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0-cr.1 to 2.2.0

4

index.js

@@ -325,2 +325,6 @@ /*

Keycloak.prototype.redirectToLogin = function (request) {
return !this.config.bearerOnly;
};
module.exports = Keycloak;

6

middleware/protect.js

@@ -60,8 +60,8 @@ /*

if (keycloak.config.bearerOnly) {
if (keycloak.redirectToLogin(request)) {
forceLogin(keycloak, request, response);
} else {
return keycloak.accessDenied(request, response, next);
} else {
forceLogin(keycloak, request, response);
}
};
};
{
"name": "keycloak-connect",
"version": "2.2.0-cr.1",
"version": "2.2.0",
"description": "Keycloak Connect Middleware",

@@ -5,0 +5,0 @@ "homepage": "http://keycloak.org",

@@ -97,3 +97,19 @@ # Keycloak

app.get( '/:section/:page', keycloak.protect( protectBySection ), sectionHandler );
### Advanced Login Configuration
By default, all unauthorized requests will be redirected to the Keycloak login
page unless your client is bearer-only. However, a confidential or public client
may host both browsable and API endpoints. To prevent redirects on unauthenticated
API requests and instead return an HTTP 401, you can override the `redirectToLogin`
function.
For example, this override checks if the url contains /api/ and disables login
redirects:
Keycloak.prototype.redirectToLogin = function(req) {
var apiReqMatcher = /\/api\//i;
return !apiReqMatcher.test(req.originalUrl || req.url);
};
## Additional URLs

@@ -100,0 +116,0 @@

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