Skip to content

Instantly share code, notes, and snippets.

View thomasdarimont's full-sized avatar
🏠
Working from home

Thomas Darimont thomasdarimont

🏠
Working from home
View GitHub Profile
{
"clientId": "reference-client",
"name": "",
"description": "",
"rootUrl": "",
"adminUrl": "",
"baseUrl": "",
"surrogateAuthRequired": false,
"enabled": true,
"alwaysDisplayInConsole": false,
@thomasdarimont
thomasdarimont / realm-export-acr-import-bug.json
Created September 11, 2024 10:39
Keycloak ACR Values Realm Import Bug with Keycloak 24.x and 25.x
{
"id": "8d394374-7fc5-4ae5-bcb1-ba72a952209c",
"realm": "acr-impor-bug",
"displayName": "",
"displayNameHtml": "",
"notBefore": 0,
"defaultSignatureAlgorithm": "RS256",
"revokeRefreshToken": false,
"refreshTokenMaxReuse": 0,
"accessTokenLifespan": 300,
@thomasdarimont
thomasdarimont / custom-login.css
Last active July 19, 2024 10:10
Custom footer with custom theme based on keycloak.v2/login
#kc-login-footer-links {
text-align: center;
}
#kc-login-footer-links li{
display:inline-block;
}
@thomasdarimont
thomasdarimont / footer.ftl
Last active July 18, 2024 13:08
Keycloak Login template.ftl with support for footer macros
@thomasdarimont
thomasdarimont / DataSourceProvider.java
Last active July 4, 2024 11:38
Example for using datasource_injecter_class in with Keycloak 25.0.1, JGroups 5.3.7 and JDBC_PING
package org.keycloak.support.jgroups;
import jakarta.enterprise.inject.spi.CDI;
import org.jboss.logging.Logger;
import org.jgroups.protocols.JDBC_PING;
import javax.sql.DataSource;
import java.util.function.Function;
public class DataSourceProvider implements Function<JDBC_PING, DataSource> {
@thomasdarimont
thomasdarimont / GetMethodSourceDemo.java
Last active July 1, 2024 08:18
PoC for fetching the Java source code of an artifact from a maven repository
package demo;
import com.github.javaparser.JavaParser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.body.MethodDeclaration;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
@thomasdarimont
thomasdarimont / docker-compose.yml
Last active June 26, 2024 19:57
Keycloak KrankenD cookie_key PoC
services:
krakend:
image: devopsfaith/krakend:2.6
ports:
- "8080:8080"
volumes:
- ./krankend/krakend.json:/etc/krakend/krakend.json
keycloak:
image: quay.io/keycloak/keycloak:25.0.1
@thomasdarimont
thomasdarimont / ExampleResource.java
Created June 7, 2024 13:08
Quarkus app prints wrong error message when run with quarkus:dev and another application is already using port 8080
package org.example;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/hello")
public class ExampleResource {
package com.github.thomasdarimont.keycloak.custom.oidc.introspection;
import com.google.auto.service.AutoService;
import jakarta.ws.rs.core.Response;
import lombok.extern.jbosslog.JBossLog;
import org.keycloak.events.EventBuilder;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.UserModel;
import org.keycloak.protocol.oidc.AccessTokenIntrospectionProvider;
import org.keycloak.protocol.oidc.AccessTokenIntrospectionProviderFactory;
@thomasdarimont
thomasdarimont / GreetingResource.java
Last active May 2, 2024 21:03
Reproducer for Quarkus Bug GH-40420 "io.quarkus.runtime.RuntimeValue.getValue()" because "frameworkRouter" is null
package org.acme;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/hello")
public class GreetingResource {