Skip to content

Instantly share code, notes, and snippets.

View lurodrig's full-sized avatar

Luis Rodríguez Fernández lurodrig

View GitHub Profile
@lurodrig
lurodrig / Dockerfile.pdfjs.builder
Created April 29, 2022 07:52
Dockerfile for building pdfjs component for alfresco share
FROM alpine:3.15.4
RUN apk add -U curl \
&& apk add -U unzip \
&& rm -rf /var/cache/apk/*
# Download the latest release of pdfjs from github:
RUN curl --request GET -sL \
--url 'https://github.com/mozilla/pdf.js/releases/download/v2.13.216/pdfjs-2.13.216-dist.zip' \
--output '/tmp/pdfjs-2.13.216-dist.zip'
@lurodrig
lurodrig / signature.xml
Created March 30, 2021 16:11
SAMLResponse signature part from keycloak IdP server
<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
<dsig:SignedInfo>
<dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<dsig:Reference URI="#ID_9f51892d-e2a1-40ff-af6a-c00d577ce908">
<dsig:Transforms>
<dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
@lurodrig
lurodrig / keycloak-test-realm-single-group-attribte-off.json
Created October 1, 2020 07:47
Keycloak test realm with client group mapper with single attribute turned OFF
{
"id": "testrealm",
"realm": "testrealm",
"notBefore": 0,
"revokeRefreshToken": false,
"refreshTokenMaxReuse": 0,
"accessTokenLifespan": 300,
"accessTokenLifespanForImplicitFlow": 900,
"ssoSessionIdleTimeout": 1800,
"ssoSessionMaxLifespan": 36000,
{
"realm": "test",
"auth-server-url": "http://localhost:9090/auth/",
"ssl-required": "external",
"resource": "apache-tomcat-9.0.37-manager",
"credentials": {
"secret": "e28eb8c6-0ef4-4763-a9a3-3cc68afbbb95"
},
"confidential-port": 0,
"principal-attribute": "preferred_username"
{
"id" : "test",
"realm" : "test",
"notBefore" : 0,
"revokeRefreshToken" : false,
"refreshTokenMaxReuse" : 0,
"accessTokenLifespan" : 300,
"accessTokenLifespanForImplicitFlow" : 900,
"ssoSessionIdleTimeout" : 1800,
"ssoSessionMaxLifespan" : 36000,
@lurodrig
lurodrig / keycloak-saml-client.json
Last active May 10, 2019 07:28
keycloak-saml-client & ldap conf
{
"id": "cfb54d2f-3f83-4dec-9eb1-0422ab814932",
"clientId": "http://localhost:8082/web-module-1/",
"name": "http://localhost:8082/web-module-1/",
"baseUrl": "http://localhost:8082/web-module-1",
"surrogateAuthRequired": false,
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "**********",
"redirectUris": [
/*
web.xml fragment
<filter>
<filter-name>CustomKeycloakSamlFilter</filter-name>
<filter-class>ch.cern.sso.cross.context.security.filter.CustomKeycloakSamlFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CustomKeycloakSamlFilter</filter-name>
<url-pattern>/*</url-pattern>
{
"id": "demo",
"realm": "demo",
"enabled": true,
"sslRequired": "external",
"registrationAllowed": true,
"resetPasswordAllowed": true,
"privateKey": "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=",
"publicKey": "MIGfMA0GCSqG
@lurodrig
lurodrig / .java
Last active November 13, 2018 17:23
import org.openqa.selenium.WebDriver;
static WebDriver browser;
@Before
public void initBrowser() {
HtmlUnitTestDriver d = new HtmlUnitTestDriver();
d.getWebClient().getOptions().setJavaScriptEnabled(true);
d.getWebClient().getOptions().setCssEnabled(false);
<html>
<head>
<title>Sample "Hello, World" Application</title>
<script type="text/javascript">
function crossContextRequest() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
if (xmlhttp.status == 200) {