Skip to content

Instantly share code, notes, and snippets.

View slauth's full-sized avatar

slauth

  • Meerbusch, Germany
View GitHub Profile
@slauth
slauth / gist:70c497f8d121860512924481e7f04ff4
Created September 10, 2021 12:00
Replace Markdown links with Asciidoc ones
Search: (\[([^\]]+)\])\((([^\)]+))\)
Replace: $3$1
@slauth
slauth / KeycloakTokenProvider.java
Created October 27, 2021 13:42
Helper component that provides a valid token to access Keycloak's REST API
package com.example.demo;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.math.BigInteger;