keycloak

My id provider returns a value Keycloak doesn't understand. What can I do?

眉间皱痕 提交于 2020-07-09 15:58:08
问题 I'm using Keycloak with an external OAuth server used as id provider. When I try to login, Keycloak send an authentication backchannel request in which the OAuth server replies with a JWT. When decoding that JWT, Keycloak fails with this exception Caused by: com.fasterxml.jackson.core.JsonParseException: Numeric value (1539167070926) out of range of int at [Source: (byte[])"{"sub":"20008203","aud":"Test-Keycloak","amr":["pwd","mobile"],"iss":"oauth","exp":1539167070926,"iat":1539163470926,

Keycloak and Spring Boot web app in dockerized environment

风格不统一 提交于 2020-07-07 06:04:28
问题 Consider the following environment: one docker container is keycloak another docker container is our web app that uses keycloak for authentication The web app is a Spring Boot application with "keycloak-spring-boot-starter" applied. In application.properties: keycloak.auth-server-url = http://localhost:8028/auth A user accessing our web app will be redirected to keycloak using the URL for the exposed port of the keycloak docker container. Login is done without problems in keycloak and the

Keycloak and Spring Boot web app in dockerized environment

≯℡__Kan透↙ 提交于 2020-07-07 06:03:51
问题 Consider the following environment: one docker container is keycloak another docker container is our web app that uses keycloak for authentication The web app is a Spring Boot application with "keycloak-spring-boot-starter" applied. In application.properties: keycloak.auth-server-url = http://localhost:8028/auth A user accessing our web app will be redirected to keycloak using the URL for the exposed port of the keycloak docker container. Login is done without problems in keycloak and the

Keycloak and Spring Boot web app in dockerized environment

拜拜、爱过 提交于 2020-07-07 06:03:06
问题 Consider the following environment: one docker container is keycloak another docker container is our web app that uses keycloak for authentication The web app is a Spring Boot application with "keycloak-spring-boot-starter" applied. In application.properties: keycloak.auth-server-url = http://localhost:8028/auth A user accessing our web app will be redirected to keycloak using the URL for the exposed port of the keycloak docker container. Login is done without problems in keycloak and the

How to test Keycloak authentication in Spring Boot application?

青春壹個敷衍的年華 提交于 2020-07-05 10:38:05
问题 In a Spring Boot project we enabled Spring Security and applied Keycloak authentication with bearer token like described in the following articles: https://www.keycloak.org/docs/3.2/securing_apps/topics/oidc/java/spring-security-adapter.html https://www.keycloak.org/docs/3.2/securing_apps/topics/oidc/java/spring-boot-adapter.html But i can't find any recommendations how to make automation tests so that the Keycloak config is applied. So, how to test/mock/verify the Keycloak configuration when

keycloak bearer-only clients: why do they exist?

我是研究僧i 提交于 2020-07-05 05:57:11
问题 I am trying to wrap my head around the concept of bearer-only clients in Keycloak. I understand the concept of public vs confidential and the concept of service accounts and the grant_type=client_credentials stuff. But with bearer-only , I'm stuck. Googling only reveals fragments of discussions saying: You cannot obtain a token from keycloak with a bearer-only client. The docs are unclear as well. All they say is: Bearer-only access type means that the application only allows bearer token

Invalid token issuer when running keycloak behind proxy

拈花ヽ惹草 提交于 2020-07-02 09:15:55
问题 I've placed my keycloak server behind apache proxy: ProxyRequests On ProxyVia On ProxyPreserveHost On SSLProxyEngine On SSLProxyCheckPeerCN on SSLProxyCheckPeerExpire on <LocationMatch "/auth/"> ProxyPass http://keycloak:8090/auth/ Keepalive=On </LocationMatch> ProxyPassReverse "/auth/" "http://keycloak:8090/auth/" I've succesfully told my keycloak on javascript side to use /auth for authentication: { "realm" : "local", "auth-server-url" : "/auth", "ssl-required" : "external", "resource" :

Invalid token issuer when running keycloak behind proxy

时光毁灭记忆、已成空白 提交于 2020-07-02 09:14:52
问题 I've placed my keycloak server behind apache proxy: ProxyRequests On ProxyVia On ProxyPreserveHost On SSLProxyEngine On SSLProxyCheckPeerCN on SSLProxyCheckPeerExpire on <LocationMatch "/auth/"> ProxyPass http://keycloak:8090/auth/ Keepalive=On </LocationMatch> ProxyPassReverse "/auth/" "http://keycloak:8090/auth/" I've succesfully told my keycloak on javascript side to use /auth for authentication: { "realm" : "local", "auth-server-url" : "/auth", "ssl-required" : "external", "resource" :

Securing thorntail service with KEYCLOAK

末鹿安然 提交于 2020-06-29 05:04:50
问题 I see a lot of topics about this but it seems that all of them access KEYCLOAK with the same URL. Explanation. I try to set up un frontend+microservice secured by KC achitecture. See the drawing : Everything work well if keycloak (kc) is seen by everybody with the same url, that is for JS : const keycloakURL = "http://test-kc-keycloak:8080/auth"; const keycloakParams = { url: keycloakURL, realm: "Test", clientId: "IHM" }; const keycloak = Keycloak(keycloakParams); ... For the service (project

How to add HTTP methods in Keycloak resources for Authorization (Without adapters)

删除回忆录丶 提交于 2020-06-29 03:53:42
问题 When using Keycloak for authorization it allows creating protected resources. But it only allows defining the URI. How can I also add the HTTP method for the resource? Although it seems the policy enforcers allows us to define such details, how is Keycloak able to map the HTTP method with the resource? Thanks in Advance. 回答1: If you want scopes to be mapped to HTTP methods then you need to set http-method-as-scope to true. You can check policy enforcer documentation here With spring-boot