Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Charles Moulliard cmoulliard

🏠
Working from home
View GitHub Profile
View gist:0dc9a0981ad9099bb4e6
package org.jboss.fuse.camel;
import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View demo.json
{
"id" : "aa61d4ca-906a-45f7-a665-35f1e7c111d4",
"realm" : "demo",
"notBefore" : 0,
"accessTokenLifespan" : 300,
"ssoSessionIdleTimeout" : 1800,
"ssoSessionMaxLifespan" : 36000,
"accessCodeLifespan" : 60,
"accessCodeLifespanUserAction" : 300,
"accessCodeLifespanLogin" : 1800,
View oauth2-script.sh
#!/usr/bin/env bash
REALM=demo
USER=demo
PASSWORD=demo
HOST=127.0.0.1
PORT_HTTP=8080
PORT_HTTPS=8443
#TOKEN=$(curl -X POST http://127.0.0.1:8080/auth/realms/$REALM/protocol/openid-connect/token -H "Content-Type: application/x-www-form-urlencoded" -d 'username=$USER' -d 'password=$PASSWORD' -d 'grant_type=password' -d 'client_id=$USER' | jq -r '.access_token')
View common-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring-security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd
http://camel.apache.org/schema/spring-security
View WebServiceAuthenticateCustomerUsingRealmTest.java
package com.redhat.fuse.example.camel;
import com.redhat.fuse.example.CustomerService;
import com.redhat.fuse.example.CustomerType;
import com.redhat.fuse.example.GetCustomerByName;
import com.redhat.fuse.example.GetCustomerByNameResponse;
import org.apache.camel.CamelContext;
import org.apache.camel.test.junit4.CamelSpringTestSupport;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
@cmoulliard
cmoulliard / CamelContext2.xml
Created Jan 16, 2013
camel-spring-security
View CamelContext2.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf
View gist:5524658
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring
View gist:5531315
package org.jboss.fuse.training.camel;
import org.apache.camel.*;
import org.apache.camel.builder.DefaultErrorHandlerBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.*;
import org.apache.camel.spi.RouteContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View gist:5531375
package org.jboss.fuse.training.camel;
import java.util.Date;
import org.apache.camel.Exchange;
import org.apache.camel.LoggingLevel;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.main.Main;
import org.slf4j.Logger;
View gist:5531373
package org.jboss.fuse.training.camel;
import org.apache.camel.*;
import org.apache.camel.builder.DefaultErrorHandlerBuilder;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.*;
import org.apache.camel.spi.RouteContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;