keycloak

Spring boot and Keycloak

不想你离开。 提交于 2019-12-11 08:40:12
问题 I'm using this example: https://github.com/foo4u/keycloak-spring-demo I have keycloak.json file in my WEB-INF folder, but when I run my application, I get this exception: java.lang.RuntimeException: Must set 'realm' in config Full stack of this exception: java.lang.RuntimeException: Must set 'realm' in config at org.keycloak.adapters.KeycloakDeploymentBuilder.internalBuild(KeycloakDeploymentBuilder.java:53) ~[keycloak-adapter-core-2.4.0.Final.jar:2.4.0.Final] at org.keycloak.adapters

Use keycloak.protect() with express.Router()

﹥>﹥吖頭↗ 提交于 2019-12-11 07:48:20
问题 I want to secure my routes using Keycloak which is an open source identity and access management. I have tried to follow their documentation but I was not able to make it work. Here is my app.js file: const express = require( 'express' ); const routePlaces = require( './routes/placesRoutes' ); const Keycloak = require( 'keycloak-connect' ); const session = require( 'express-session' ); const memoryStrore = new session.MemoryStore(); let kcConfig = { clientId = 'parking-app', bearerOnly: true,

Spring Boot / Security classloader issues with Keycloak run from terminal

偶尔善良 提交于 2019-12-11 07:21:54
问题 I use Spring Boot and Spring Security in combination with Keycloak. The build tool is gradle. When I run ./gradlew bootRun the application works flawless. If I use the resulting fat jar (i.e. java -jar myapp.jar ) the application will boot but I encounter an exception when the application tries to invoke some keyloak stuff: java.lang.IllegalArgumentException: org.keycloak.admin.client.resource.RealmsResource referenced from a method is not visible from class loader at java.base/java.lang

Zabbix HTTP authentication with Keycloak-proxy

孤街浪徒 提交于 2019-12-11 06:55:16
问题 I'm try to integrate Zabbix UI with Keycloak SSO, using keycloak-proxy. My setup is the following: Nginx is the entry point: it handles the "virtual host", forwarding the requests to keycloak-proxy. Keyclock-proxy is configured with client_id, client_secret, etc. to authenticate the users to Keycloak; Zabbix dashboard on Apache, default setup: I enable the HTTP authentication. I've created a test user both in Keycloak and Zabbix. The authentication flow is ok: I'm redirected to KeyCloak, I do

Spring Security + Keycloak - How to handle Ajax Requests in conjunction with “Access Token Lifespan”

断了今生、忘了曾经 提交于 2019-12-11 06:04:01
问题 I recently implemented Keycloak into my Primefaces Spring-Boot Web Application. It all works great except one thing: Ajax request "timeout" after whatever is set in keycloak under "Access Token Lifespan". There is no redirect. The ajaxStatus never ends and the user is forced to reload the page. Looking at the Request, I am getting back a 401 "Unauthorized". E.g. the user loads a site and does whatever he wants to do. After 5 minutes of time without reloading or navigation to another page,

Perl Regular expression | how to exclude words from a file

无人久伴 提交于 2019-12-11 01:52:45
问题 i searching to find some Perl Regular Expression Syntax about some requirements i have in a project. First i want to exclude strings from a txt file (dictionary). For example if my file have this strings: path.../Document.txt | tree car ship i using Regular Expression a1testtre -- match orangesh1 -- match apleship3 -- not match [contains word from file ] Also i have one more requirement that i couldnt solve. I have to create a Regex that not allow a String to have over 3 times a char repeat

Keycloak | Cannot await on updateToken() in async function

↘锁芯ラ 提交于 2019-12-11 01:26:08
问题 We are developing Spring application with React/Redux frontend. We successfully integrated it with Keycloak authentication service. However, we encountered unwanted behaviour after access token timed out. Our restMiddleware looks like this (simplified): function restMiddleware() { return (next) => async (action) => { try{ await keycloak.updateToken(5); res = await fetch(restCall.url, { ...restCall.options, ...{ credentials: 'same-origin', headers: { Authorization: 'Bearer ' + keycloak.token }

Disable Keycloak authentication for a specific url in spring-boot

做~自己de王妃 提交于 2019-12-10 22:28:44
问题 Front end of my spring-boot service gets rendered in a 3rd party dashboard. That dashboard also has a generic search bar which we want to use. Now, once we implemented Keycloak authentication, we started facing problems specifically in this search bar. All the other API's works fine because they are called from my front end only, But search API gets called by the 3rd party dashboard. Weirdly, 3rd party calls my method using Http OPTION method, but my endpoint is registered as GET. For an

Keycloak - URL Reset Password email behind a proxy

和自甴很熟 提交于 2019-12-10 20:26:49
问题 We are using Keycloak 2.0.0.Final installed behind a nginx proxy on a RedHat environment. We are currently facing a problem with the Reset Password functionality which send an email with the internal server host instead of the external one in the action URL as we are behind a proxy. I receive this by email: https://internal/auth/realms/MYREALM/login-actions/reset-credentials?code=wYhHP(...) but the end user should see https://external/auth/realms/MYREALM/login-actions/reset-credentials?code

Error when running Keycloak in Docker

假装没事ソ 提交于 2019-12-10 20:15:00
问题 I am trying to run Keycloak in Docker, but its throwing an error. Here's the docker file: FROM jboss/keycloak:4.1.0.Final WORKDIR /opt/jboss/keycloak COPY realm-export.json initial_data.json RUN ./bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=initial_data.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING I am using that realm-export.json file because I have some configurations there. And the error that is showing is