├── .gitignore ├── modules ├── rampart-samples │ ├── keys │ │ ├── sts.jks │ │ ├── client.jks │ │ ├── service.jks │ │ ├── client.properties │ │ └── service.properties │ ├── basic │ │ ├── sample01 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample01 │ │ │ │ │ └── SimpleService.java │ │ │ └── services.xml │ │ ├── sample05 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample05 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample06 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample06 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample07 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample07 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample04 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample04 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample10 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample10 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample08 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample08 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample02 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample02 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample09 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample09 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample11 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── sample11 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── services.xml │ │ ├── sample03 │ │ │ ├── README.txt │ │ │ ├── services.xml │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── sample03 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ └── README.txt │ ├── policy │ │ ├── sample02 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample02 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample06 │ │ │ ├── README.txt │ │ │ ├── src │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── rampart │ │ │ │ │ └── samples │ │ │ │ │ └── policy │ │ │ │ │ └── sample06 │ │ │ │ │ ├── SimpleService.java │ │ │ │ │ └── PWCBHandler.java │ │ │ └── mex_policy.xml │ │ ├── sample03 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample03 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample01 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample01 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample08 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample08 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample04 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample04 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample07 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample07 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ ├── sample05 │ │ │ ├── README.txt │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── samples │ │ │ │ └── policy │ │ │ │ └── sample05 │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ └── sample-tomcat │ │ │ ├── src │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── rampart │ │ │ │ └── tomcat │ │ │ │ └── sample │ │ │ │ ├── SimpleService.java │ │ │ │ └── PWCBHandler.java │ │ │ ├── policy.xml │ │ │ └── README │ ├── README.txt │ └── build.xml ├── rampart-trust │ ├── sts-aar-resources │ │ ├── token-canceler-config.xml │ │ ├── rahas-sts.jks │ │ ├── sct-issuer-config.xml │ │ ├── token-dispatcher-configuration.xml │ │ └── saml-issuer-config.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── rahas │ │ ├── impl │ │ └── util │ │ │ ├── SAMLCallback.java │ │ │ ├── SAMLCallbackHandler.java │ │ │ ├── SAMLNameIdentifierCallback.java │ │ │ ├── SAMLAttributeCallback.java │ │ │ └── AxiomParserPool.java │ │ └── STSConstants.java ├── rampart-integration │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── sec.jks │ │ │ ├── sts.jks │ │ │ ├── interop2.jks │ │ │ ├── rahas │ │ │ │ ├── sec.jks │ │ │ │ ├── rahas-sts.jks │ │ │ │ ├── policy │ │ │ │ │ └── store.jks │ │ │ │ ├── issuer.properties │ │ │ │ ├── samlIssuer.properties │ │ │ │ ├── rahas-sec.properties │ │ │ │ └── saml.s1.properties │ │ │ ├── rampart │ │ │ │ ├── sts.jks │ │ │ │ ├── store.jks │ │ │ │ ├── issuer.properties │ │ │ │ ├── policy │ │ │ │ │ └── 13.xml │ │ │ │ ├── services-13.xml │ │ │ │ └── services-1.xml │ │ │ ├── security │ │ │ │ ├── sc │ │ │ │ │ ├── sec.jks │ │ │ │ │ ├── sts.jks │ │ │ │ │ ├── sctIssuer.properties │ │ │ │ │ └── sec.properties │ │ │ │ ├── sST1.service.xml │ │ │ │ ├── s1.service.xml │ │ │ │ ├── s2.service.xml │ │ │ │ ├── s5.service.xml │ │ │ │ ├── s2a.service.xml │ │ │ │ ├── s6.service.xml │ │ │ │ ├── secMtom.service.xml │ │ │ │ ├── s4.service.xml │ │ │ │ ├── s7.service.xml │ │ │ │ ├── complete.service.xml │ │ │ │ └── s3.service.xml │ │ │ ├── sec.properties │ │ │ ├── sctIssuer.properties │ │ │ ├── interop.properties │ │ │ └── commons-logging.properties │ │ └── java │ │ │ ├── commons-logging.properties │ │ │ └── org │ │ │ └── apache │ │ │ └── axis2 │ │ │ └── security │ │ │ └── Scenario1Test.java │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ ├── rahas │ │ └── Service.java │ │ └── rampart │ │ ├── RampartConfigUpdater.java │ │ └── Service.java ├── rampart-tests │ ├── test-resources │ │ ├── keys │ │ │ └── interop2.jks │ │ ├── trust │ │ │ ├── impl │ │ │ │ ├── sts.jks │ │ │ │ ├── sct-issuer-config.xml │ │ │ │ ├── sctIssuer.properties │ │ │ │ ├── token-dispatcher-configuration.xml │ │ │ │ └── sts-services.xml │ │ │ ├── dispatcher.config.invalid.2.xml │ │ │ ├── dispatcher.config.invalid.1.xml │ │ │ └── dispatcher.config.xml │ │ ├── policy │ │ │ ├── SecurityPolicyMsg.xml │ │ │ ├── rampart-policy-1.xml │ │ │ ├── SecurityPolicyBindingsSymm.xml │ │ │ ├── SecurityPolicyBindings.xml │ │ │ └── soapmessage-no-wss-header.xml │ │ ├── commons-logging.properties │ │ ├── policy-transport-binding.xml │ │ ├── policy-asymm-binding.xml │ │ └── policy-symm-binding.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── apache │ │ ├── rampart │ │ └── SecurityTokenReferenceTest.java │ │ └── rahas │ │ └── TempIssuer.java ├── documentation │ └── src │ │ └── site │ │ ├── resources │ │ ├── images │ │ │ ├── axis.jpg │ │ │ ├── axis.png │ │ │ ├── h2-bg.gif │ │ │ ├── external.png │ │ │ ├── home-top.gif │ │ │ ├── menu-back.gif │ │ │ ├── leftcolumn-bg.gif │ │ │ ├── rampart-trust.jpg │ │ │ ├── breadcrumbs-bg.gif │ │ │ ├── message-builder.jpg │ │ │ ├── rampart-engine.jpg │ │ │ ├── security-stack.jpg │ │ │ ├── rampart-handlers.jpg │ │ │ ├── apache-rampart-logo.jpg │ │ │ ├── apache-rampart-menu.jpg │ │ │ ├── logos │ │ │ │ ├── asf_logo_wide.png │ │ │ │ ├── maven-feather.png │ │ │ │ ├── build-by-maven-black.png │ │ │ │ └── build-by-maven-white.png │ │ │ ├── apache-rampart-banner.jpg │ │ │ ├── apache-rampart-menu-top.jpg │ │ │ ├── apache-rampart-spliter.jpg │ │ │ ├── apache-rampart-content-back.jpg │ │ │ ├── apache-rampart-menu-bottom.jpg │ │ │ ├── apache-rampart-menu-button.gif │ │ │ └── apache-rampart-banner-background.jpg │ │ ├── css │ │ │ └── print.css │ │ └── samples │ │ │ ├── msgs │ │ │ ├── res01.xml │ │ │ └── req01.xml │ │ │ └── policy │ │ │ ├── sample01.xml │ │ │ ├── sample02.xml │ │ │ └── sample03.xml │ │ └── xdoc │ │ └── download │ │ ├── 1.1 │ │ └── download.cgi │ │ ├── 1.2 │ │ └── download.cgi │ │ ├── 1.3 │ │ └── download.cgi │ │ ├── 1.4 │ │ └── download.cgi │ │ ├── 1.5.1 │ │ └── download.cgi │ │ └── 1.5 │ │ └── download.cgi ├── rampart-core │ └── src │ │ └── main │ │ └── java │ │ ├── META-INF │ │ └── services │ │ │ └── org.apache.neethi.builders.AssertionBuilder │ │ └── org │ │ └── apache │ │ └── rampart │ │ ├── RampartConstants.java │ │ ├── handler │ │ └── config │ │ │ ├── Resolver.java │ │ │ ├── DefaultResolver.java │ │ │ └── SystemResolver.java │ │ ├── RampartConfigCallbackHandler.java │ │ ├── PolicyValidatorCallbackHandler.java │ │ └── policy │ │ └── SupportingPolicyData.java ├── rampart-policy │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── ws │ │ └── secpolicy │ │ ├── model │ │ ├── TokenWrapper.java │ │ ├── AlgorithmWrapper.java │ │ ├── Header.java │ │ └── AbstractConfigurableSecurityAssertion.java │ │ └── WSSPolicyException.java ├── distribution │ └── src.xml ├── rampart-extensions │ └── jpam-callback-handler │ │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── rampart │ │ └── extensions │ │ └── jpam │ │ └── JPAMCallbackHandler.java └── rampart-mar │ └── module.xml ├── orbit ├── rampart-trust │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── carbon │ │ └── Dummy.java ├── rampart-core │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.apache.neethi.builders.AssertionBuilder └── pom.xml ├── release-docs ├── NOTICE.txt └── build.xml ├── issue_template.md └── legal ├── slf4j-api-LICENSE.txt └── slf4j-jdk14-LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | target 3 | .classpath 4 | .settings 5 | .project 6 | *.i?? 7 | .idea 8 | -------------------------------------------------------------------------------- /modules/rampart-samples/keys/sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-samples/keys/sts.jks -------------------------------------------------------------------------------- /modules/rampart-samples/keys/client.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-samples/keys/client.jks -------------------------------------------------------------------------------- /modules/rampart-samples/keys/service.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-samples/keys/service.jks -------------------------------------------------------------------------------- /modules/rampart-trust/sts-aar-resources/token-canceler-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /orbit/rampart-trust/src/main/java/org/wso2/carbon/Dummy.java: -------------------------------------------------------------------------------- 1 | 2 | package org.wso2.carbon; 3 | 4 | public class Dummy { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/sec.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/sec.jks -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/sts.jks -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/keys/interop2.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-tests/test-resources/keys/interop2.jks -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/impl/sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-tests/test-resources/trust/impl/sts.jks -------------------------------------------------------------------------------- /modules/rampart-trust/sts-aar-resources/rahas-sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-trust/sts-aar-resources/rahas-sts.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/axis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/axis.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/axis.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/h2-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/h2-bg.gif -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/external.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/external.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/home-top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/home-top.gif -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/interop2.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/interop2.jks -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/sec.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/rahas/sec.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/menu-back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/menu-back.gif -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/rampart/sts.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/leftcolumn-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/leftcolumn-bg.gif -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/rampart-trust.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/rampart-trust.jpg -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/store.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/rampart/store.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/breadcrumbs-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/breadcrumbs-bg.gif -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/message-builder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/message-builder.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/rampart-engine.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/rampart-engine.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/security-stack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/security-stack.jpg -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/rahas-sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/rahas/rahas-sts.jks -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/sc/sec.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/security/sc/sec.jks -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/sc/sts.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/security/sc/sts.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/rampart-handlers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/rampart-handlers.jpg -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/policy/store.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/rampart-integration/src/test/resources/rahas/policy/store.jks -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-logo.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-menu.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/logos/asf_logo_wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/logos/asf_logo_wide.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/logos/maven-feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/logos/maven-feather.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-banner.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-menu-top.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-menu-top.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-spliter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-spliter.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-content-back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-content-back.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-menu-bottom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-menu-bottom.jpg -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-menu-button.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-menu-button.gif -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/logos/build-by-maven-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/logos/build-by-maven-black.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/logos/build-by-maven-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/logos/build-by-maven-white.png -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/images/apache-rampart-banner-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/wso2-rampart/HEAD/modules/documentation/src/site/resources/images/apache-rampart-banner-background.jpg -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/impl/sct-issuer-config.xml: -------------------------------------------------------------------------------- 1 | 2 | EncryptedKey 3 | sctIssuer.properties 4 | 5 | -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/css/print.css: -------------------------------------------------------------------------------- 1 | #banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { 2 | display: none !important; 3 | } 4 | #bodyColumn, body.docs div.docs { 5 | margin: 0 !important; 6 | border: none !important 7 | } -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample01/README.txt: -------------------------------------------------------------------------------- 1 | Rampart Engaged and no configuration 2 | 3 | This sample shows that Apache Rampart does not work on the messages when simply 4 | engagd without any configuration 5 | 6 | Note: in both client.axis2.xml and services.xml -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.1/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.2/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.3/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.4/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.5.1/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/documentation/src/site/xdoc/download/1.5/download.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Wrapper script around mirrors.cgi script 3 | # (we must change to that directory in order for python to pick up the 4 | # python includes correctly) 5 | cd /www/www.apache.org/dyn/mirrors 6 | /www/www.apache.org/dyn/mirrors/mirrors.cgi $* -------------------------------------------------------------------------------- /modules/rampart-samples/keys/client.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=apache 4 | org.apache.ws.security.crypto.merlin.file=client.jks -------------------------------------------------------------------------------- /modules/rampart-samples/keys/service.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=apache 4 | org.apache.ws.security.crypto.merlin.file=service.jks -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample02/README.txt: -------------------------------------------------------------------------------- 1 | Sign only 2 | 3 | An AsymmetricBinding is used. Entire headers and body to be signed. 4 | Algorithm suite is TripleDesRsa15 5 | 6 | Note that {http://ws.apache.org/rampart/policy}RampartConfig assertion provides 7 | additional information required to secure the message. -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/META-INF/services/org.apache.neethi.builders.AssertionBuilder: -------------------------------------------------------------------------------- 1 | org.apache.rampart.policy.builders.CryptoConfigBuilder 2 | org.apache.rampart.policy.builders.RampartConfigBuilder 3 | org.apache.rampart.policy.builders.SSLConfigBuilder 4 | org.apache.rampart.policy.builders.KerberosConfigBuilder -------------------------------------------------------------------------------- /release-docs/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Rampart 2 | Copyright 2010 The Apache Software Foundation 3 | 4 | This product includes software developed by 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | Please read the different LICENSE files present in the lib directory of 8 | this distribution. 9 | 10 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/dispatcher.config.invalid.2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | http://example.org/mySpecialToken2 5 | 6 | 7 | -------------------------------------------------------------------------------- /orbit/rampart-core/src/main/resources/META-INF/services/org.apache.neethi.builders.AssertionBuilder: -------------------------------------------------------------------------------- 1 | org.apache.rampart.policy.builders.CryptoConfigBuilder 2 | org.apache.rampart.policy.builders.RampartConfigBuilder 3 | org.apache.rampart.policy.builders.SSLConfigBuilder 4 | org.apache.rampart.policy.builders.KerberosConfigBuilder -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/sec.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sec.jks 5 | 6 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/sctIssuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sts.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample05/README.txt: -------------------------------------------------------------------------------- 1 | Encrypting messages 2 | 3 | Both client and servce are configured to encrypt the outgoing message and to 4 | decrypt incoming message using their key pairs. 5 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 6 | client.axis2.xml and serivces.xml files 7 | 8 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample06/README.txt: -------------------------------------------------------------------------------- 1 | WS-Trust ( With WS Metada Exchange) - RST - Resquest Security Token Service - Issuing a SAML token - issuing a token 2 | 3 | When using this sample with the TCPMon to monitor the soap messages, you have to use the 4 | correct URL in the client code before build the sample 05. 5 | 6 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/impl/sctIssuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sts.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/interop.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=interop2.jks 5 | 6 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/issuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=rahas-sts.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/samlIssuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sts.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/dispatcher.config.invalid.1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://example.org/mySpecialToken1 4 | http://example.org/mySpecialToken2 5 | 6 | 7 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/sc/sctIssuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sts.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/sc/sec.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=sec.jks 5 | 6 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/dispatcher.config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://example.org/mySpecialToken1 4 | http://example.org/mySpecialToken2 5 | 6 | 7 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/issuer.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=rampart/store.jks 5 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/rahas-sec.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin 2 | org.apache.ws.security.crypto.merlin.keystore.type=jks 3 | org.apache.ws.security.crypto.merlin.keystore.password=password 4 | org.apache.ws.security.crypto.merlin.file=rahas/rahas-sts.jks 5 | 6 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample06/README.txt: -------------------------------------------------------------------------------- 1 | Sign and encrypt messages 2 | 3 | Both client and servce are configured to first sign and then encrypt the 4 | outgoing message and to decrypt and verify the incoming message using their 5 | key pairs. 6 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 7 | client.axis2.xml and serivces.xml files 8 | 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample07/README.txt: -------------------------------------------------------------------------------- 1 | Encrypt and sign messages 2 | 3 | Both client and servce are configured to first encrypt and then sign the 4 | outgoing message and to verify and decrypt the incoming message using their 5 | key pairs. 6 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 7 | client.axis2.xml and serivces.xml files 8 | 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample04/README.txt: -------------------------------------------------------------------------------- 1 | Message integrity and non-repudiation with signature 2 | 3 | Both client and servce are configured to sign the outgoing message and to verify 4 | the signature of the incoming message using their key pairs. 5 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 6 | client.axis2.xml and serivces.xml files 7 | 8 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/impl/token-dispatcher-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sct-issuer-config.xml 4 | http://schemas.xmlsoap.org/ws/2005/02/sc/sct 5 | 6 | 7 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample03/README.txt: -------------------------------------------------------------------------------- 1 | Sign and Encrypt messages 2 | 3 | An AsymmetricBinding is used. Entire headers and body to be signed. 4 | EncryptionParts specifies the Body to be encrypted. 5 | 6 | Algorithm suite is TripleDesRsa15 7 | 8 | Note that {http://ws.apache.org/rampart/policy}RampartConfig assertion provides 9 | additional information required to secure the message. -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample01/README.txt: -------------------------------------------------------------------------------- 1 | UsernameToken Authentication 2 | 3 | The policy uses a TransportBinding and requires a SignedSupportingToken which 4 | is a UsernameToken and the inclusion of a TimeStamp. 5 | 6 | Note that Rampart does not enforce the use of HTTPS transport and that 7 | {http://ws.apache.org/rampart/policy}RampartConfig assertion provides 8 | additional information required to secure the message. -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample10/README.txt: -------------------------------------------------------------------------------- 1 | Sign and encrypt messages 2 | 3 | Both client and servce are configured to first sign and then encrypt the 4 | outgoing message and to decrypt and verify the incoming message using their 5 | key pairs. 6 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 7 | client.axis2.xml and serivces.xml files 8 | - Note the use of [xpath expression] 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample08/README.txt: -------------------------------------------------------------------------------- 1 | Signing twice 2 | 3 | The client is configured to sign the outgoing message twice 4 | - See the "OutflowSecurity" parameter in the client.axis2.xml 5 | - Note the aditional element that defines the second signature. 6 | 7 | The service is configured to process it. 8 | - See the "InflowSecurity" parameter in the services.xml. Not that we 9 | simply use "Signature Signature" as action items. 10 | 11 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample02/README.txt: -------------------------------------------------------------------------------- 1 | UsernameToken authentication 2 | 3 | The client is configured to add a UsernameToken to the outgoing message. 4 | - See the "OutflowSecurity" parameter in the client.axis2.xml 5 | 6 | The service is configured to process it. 7 | - See the "InflowSecurity" parameter in the services.xml 8 | 9 | Note how org.apache.rampart.samples.sample02.PWCBHandler supplies the password 10 | to wss4j to compute the digest for comparison. 11 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample09/README.txt: -------------------------------------------------------------------------------- 1 | Encryption with a key known to both parties 2 | 3 | Both client and servce are configured to encrypt the outgoing message and to 4 | decrypt incoming message using a known named key 5 | - See the "OutflowSecurity" and "InflowSecurity" parameters in the 6 | client.axis2.xml and serivces.xml files 7 | - Note the use of SessionKey 8 | - Note that org.apache.rampart.samples.sample09.PWCBHandler sets the key 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample11/README.txt: -------------------------------------------------------------------------------- 1 | Dynamic configuration : Get rid of the config files ... let's use code! 2 | 3 | Both client and servce are configured to first sign and then encrypt the 4 | outgoing message and to decrypt and verify the incoming message using their 5 | key pairs. 6 | - Note that we don't use any parameters in the client.axis2.xml 7 | - See org.apache.rampart.samples.sample11.Client's getOutflowConfiguration() 8 | getInflowConfiguration() methods and their usage. 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample08/README.txt: -------------------------------------------------------------------------------- 1 | WS-Trust - RST - Resquest Security Token Service - Issuing a SAML 2.0 token - issuing a token 2 | 3 | When using this sample with the TCPMon to monitor the soap messages, you have to use the 4 | correct URL in the client code before build the sample 08. 5 | 6 | You have to endorse the default JAXP implementation of your JDK before invoking this sample. 7 | Please follow the instructions available in the README.txt of this distribution to endorse 8 | the default JAXP implementation. 9 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample03/README.txt: -------------------------------------------------------------------------------- 1 | UsernameToken authentication with a plain text password 2 | 3 | The client is configured to add a UsernameToken to the outgoing message. 4 | - See the "OutflowSecurity" parameter in the client.axis2.xml 5 | - Note the PasswordText element 6 | 7 | The service is configured to process it. 8 | - See the "InflowSecurity" parameter in the services.xml 9 | 10 | Note how org.apache.rampart.samples.sample03.PWCBHandler authenticates the 11 | password 12 | 13 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample04/README.txt: -------------------------------------------------------------------------------- 1 | SecureConversation 2 | 3 | The secure session is bootstrapped using a SymetricBinding which uses 4 | derived keys based on an ephemeral key. 5 | 6 | Messages in the secure conversation : 7 | - Includes a timestamp 8 | - All headers are signed along with the timestamp 9 | - Signature encrypted 10 | - Body encrypted 11 | 12 | Algorithm suite is Basic128Rsa15 13 | 14 | Note that {http://ws.apache.org/rampart/policy}RampartConfig assertion provides 15 | additional information required to secure the message. -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/sST1.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Timestamp SAMLTokenUnsigned 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLCallback.java: -------------------------------------------------------------------------------- 1 | package org.apache.rahas.impl.util; 2 | 3 | /** 4 | * All SAML data retrieving call backs will implement this interface 5 | * 6 | */ 7 | public interface SAMLCallback { 8 | 9 | /** 10 | * Attribute callback 11 | */ 12 | public static final int ATTR_CALLBACK = 1; 13 | 14 | /** 15 | * Subject name identifier 16 | */ 17 | public static final int NAME_IDENTIFIER_CALLBACK = 2; 18 | 19 | /** 20 | * Returns the type of callback 21 | * @return 22 | */ 23 | int getCallbackType(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s1.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | UsernameToken 11 | org.apache.axis2.security.PWCallback 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample07/README.txt: -------------------------------------------------------------------------------- 1 | Sign and Encrypt messages with multiple X509 certficates with multiple supporting tokens. 2 | 3 | An AsymmetricBinding is used. 4 | 5 | Multiple Supporting Tokens used each having different X509 certs for signature and encryption. 6 | 7 | X509Token asserton carries a RampartConfig assertion to specify the keys that needs to be used to sign/encrypt 8 | EncryptedElements/EncryptedParts/SignedElements/SignedParts 9 | 10 | Algorithm suite is TripleDesRsa15 11 | 12 | Note that {http://ws.apache.org/rampart/policy}RampartConfig assertion provides 13 | additional information required to secure the message. -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/samples/msgs/res01.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://www.w3.org/2005/08/addressing/soap/fault 4 | urn:uuid:AEDBA74A8D1FC94B631214227032877 5 | 6 | 7 | 8 | Hello world 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample05/README.txt: -------------------------------------------------------------------------------- 1 | WS-Trust - RST - Resquest Security Token Service - Issuing a SAML token - issuing a token 2 | 3 | When using this sample with the TCPMon to monitor the soap messages, you have to use the 4 | correct URL in the client code before build the sample 05. 5 | 6 | There is a known bug in OpenSAML-1.1.jar, which is used for implementing SAML 1.1 support in Rampart. 7 | So before you run this sample, please download the patched OpenSAML jar from here[1], and replace it 8 | with the OpenSAML-1.1.jar in your $AXIS2_HOME/lib. 9 | 10 | [1] - http://dist.wso2.org/maven2/opensaml/opensaml/1.1.406/opensaml-1.1.406.jar 11 | 12 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rahas/saml.s1.properties: -------------------------------------------------------------------------------- 1 | org.apache.ws.security.saml.issuerClass=org.apache.ws.security.saml.SAMLIssuerImpl 2 | org.apache.ws.security.saml.issuer.cryptoProp.file=sctIssuer.properties 3 | org.apache.ws.security.saml.issuer.key.name=bob 4 | org.apache.ws.security.saml.issuer.key.password=security 5 | org.apache.ws.security.saml.issuer=www.example.com 6 | org.apache.ws.security.saml.subjectNameId.name=uid=joe,ou=people,ou=saml-demo,o=example.com 7 | org.apache.ws.security.saml.subjectNameId.qualifier=www.example.com 8 | org.apache.ws.security.saml.authenticationMethod=password 9 | #org.apache.ws.security.saml.confirmationMethod=senderVouches 10 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s2.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | UsernameToken Encrypt 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s5.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Signature Signature Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s2a.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | UsernameTokenSignature UsernameToken Encrypt Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy/SecurityPolicyMsg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy/rampart-policy-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | alice 4 | bob 5 | org.apache.axis2.security.PWCallback 6 | 7 | 8 | 9 | JKS 10 | /path/to/file.jks 11 | password 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/RampartConstants.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart; 2 | 3 | public class RampartConstants { 4 | 5 | public static final String TIME_LOG = "org.apache.rampart.TIME"; 6 | public static final String MESSAGE_LOG = "org.apache.rampart.MESSAGE"; 7 | public static final String SEC_FAULT = "SECURITY_VALIDATION_FAILURE"; 8 | public static final String MERLIN_CRYPTO_IMPL = "org.apache.ws.security.components.crypto.Merlin"; 9 | public static final String MERLIN_CRYPTO_IMPL_CACHE_KEY = "org.apache.ws.security.crypto.merlin.file"; 10 | public static final String SAML_ASSERTION_ID = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID"; 11 | public static final String SAML_SUBJECT_ID = "saml.subject.id"; 12 | public final static String HMAC_SHA1 = "http://www.w3.org/2000/09/xmldsig#hmac-sha1"; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/STSConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rahas; 17 | 18 | public class STSConstants { 19 | 20 | public static final String KEY_ISSUER_CONFIG = "IssuerConfig"; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/TokenWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.ws.secpolicy.model; 18 | 19 | public interface TokenWrapper { 20 | 21 | public void setToken(Token tok); 22 | } 23 | -------------------------------------------------------------------------------- /modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AlgorithmWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.ws.secpolicy.model; 18 | 19 | public interface AlgorithmWrapper { 20 | 21 | public void setAlgorithmSuite(AlgorithmSuite algorithmSuite); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLCallbackHandler.java: -------------------------------------------------------------------------------- 1 | package org.apache.rahas.impl.util; 2 | 3 | import org.opensaml.saml.common.SAMLException; 4 | 5 | /** 6 | * SAMLCallback Handler enables you to add data to the 7 | * to the SAMLAssertion. 8 | * 9 | * For example Assertions, NameIdentifiers. 10 | * 11 | */ 12 | public interface SAMLCallbackHandler { 13 | 14 | /** 15 | * SAMLCallback object has indicates what kind of data is required. 16 | * if(callback.getCallbackType() == SAMLCallback.ATTR_CALLBACK) 17 | * { 18 | * SAMLAttributeCallback attrCallback = (SAMLAttributeCallback)callback; 19 | * \//Retrieve required data from the RahasData inside SAMLAttributeCallback 20 | * \//Add your SAMLAttributes to the attrCallback here. 21 | * 22 | * } 23 | * @param callback 24 | * @throws SAMLException 25 | */ 26 | public void handle(SAMLCallback callback) throws SAMLException; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample01/src/org/apache/rampart/samples/sample01/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.sample01; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample02/src/org/apache/rampart/samples/sample02/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package org.apache.rampart.samples.sample02; 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample04/src/org/apache/rampart/samples/sample04/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample04; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample05/src/org/apache/rampart/samples/sample05/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample05; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample06/src/org/apache/rampart/samples/sample06/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample06; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample07/src/org/apache/rampart/samples/sample07/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample07; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample08/src/org/apache/rampart/samples/sample08/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample08; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample09/src/org/apache/rampart/samples/sample09/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample09; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample10/src/org/apache/rampart/samples/sample10/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample10; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample11/src/org/apache/rampart/samples/sample11/SimpleService.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.samples.sample11; 2 | /* 3 | 4 | * Copyright 2003-2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) { 23 | return arg; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample01/src/org/apache/rampart/samples/policy/sample01/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample01; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample02/src/org/apache/rampart/samples/policy/sample02/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample02; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample03/src/org/apache/rampart/samples/policy/sample03/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample03; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample04/src/org/apache/rampart/samples/policy/sample04/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample04; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample05/src/org/apache/rampart/samples/policy/sample05/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample05; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample06; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample07; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.policy.sample08; 18 | 19 | public class SimpleService { 20 | 21 | public String echo(String arg) { 22 | return arg; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLNameIdentifierCallback.java: -------------------------------------------------------------------------------- 1 | package org.apache.rahas.impl.util; 2 | 3 | import org.apache.rahas.RahasData; 4 | import org.opensaml.saml.saml1.core.NameIdentifier; 5 | 6 | /** 7 | * This is used retrieve data for the SAMLNameIdentifier. 8 | @@ -12,7 +12,7 @@ 9 | */ 10 | public class SAMLNameIdentifierCallback implements SAMLCallback{ 11 | 12 | private NameIdentifier nameId = null; 13 | private String userId = null; 14 | private RahasData data = null; 15 | 16 | public int getCallbackType(){ 17 | return SAMLCallback.NAME_IDENTIFIER_CALLBACK; 18 | } 19 | 20 | public NameIdentifier getNameId() { 21 | return nameId; 22 | } 23 | 24 | public void setNameId(NameIdentifier nameId) { 25 | this.nameId = nameId; 26 | } 27 | 28 | public void setUserId(String userId) { 29 | this.userId = userId; 30 | } 31 | public String getUserId() { 32 | return userId; 33 | } 34 | public RahasData getData() { 35 | return data; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/main/java/org/apache/rahas/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rahas; 18 | import org.apache.axiom.om.OMElement; 19 | 20 | public class Service { 21 | 22 | public OMElement echo(OMElement elem) { 23 | elem.build(); 24 | elem.detach(); 25 | System.out.println("Service invoked"); 26 | return elem; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /modules/rampart-samples/README.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | **************************** Apache Rampart Samples **************************** 3 | ******************************************************************************** 4 | 5 | This directory contains three sub directories: 6 | 7 | - basic - A set of samples that uses basic rampart configuration using 8 | parameters 9 | 10 | - policy - A set of samples that uses rampart with WS-SecurityPolicy 11 | 12 | - keys - The keystore files that contains the keys used by the samples 13 | 14 | Please use Apache Ant with the build.xml file available here to copy all jars 15 | and mars to required places. 16 | 17 | - Please copy log4j.jar to AXIS2_HOME/lib directory before trying out samples. 18 | 19 | - Please follow the instructions on endorsing the default JAXP implementation 20 | available in README.txt of this distribution before invoking 21 | Sample 08.(Issuing a SAML 2.0 Token) 22 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.tomcat.sample; 18 | 19 | 20 | public class SimpleService { 21 | 22 | public String echo(String arg) throws Exception { 23 | System.out.println("Tomcat service accessed successfully.. :)"); 24 | return arg; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/main/java/org/apache/rampart/RampartConfigUpdater.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart; 18 | 19 | import org.apache.rampart.policy.model.RampartConfig; 20 | 21 | public class RampartConfigUpdater implements RampartConfigCallbackHandler{ 22 | 23 | public void update(RampartConfig rampartConfig) { 24 | rampartConfig.setUser("alice"); 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /modules/rampart-trust/sts-aar-resources/sct-issuer-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JKS 6 | META-INF/rahas-sts.jks 7 | password 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 3 21 | 22 | 28 | BinarySecret 29 | 30 | -------------------------------------------------------------------------------- /legal/slf4j-api-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2008 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 6 | persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 11 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 12 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 13 | -------------------------------------------------------------------------------- /legal/slf4j-jdk14-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2008 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 6 | persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 11 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 12 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 13 | -------------------------------------------------------------------------------- /modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/WSSPolicyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.ws.secpolicy; 18 | 19 | public class WSSPolicyException extends Exception { 20 | 21 | private static final long serialVersionUID = 5904800255533588133L; 22 | 23 | public WSSPolicyException(String message, Throwable e) { 24 | super(message, e); 25 | } 26 | 27 | public WSSPolicyException(String message) { 28 | super(message); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample01/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample01.SimpleService 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modules/rampart-trust/sts-aar-resources/token-dispatcher-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sct-issuer-config.xml 5 | http://schemas.xmlsoap.org/ws/2005/02/sc/sct 6 | 7 | 8 | META-INF/saml-issuer-config.xml 9 | http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1 10 | 11 | 12 | META-INF/saml-issuer-config.xml 13 | http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0 14 | 15 | 16 | 17 | 18 | META-INF/token-canceler-config.xml 19 | 20 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/policy/13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/samples/policy/sample01.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/trust/impl/sts-services.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue 7 | http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Renew 8 | http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Cancel 9 | http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Validate 10 | http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT 11 | 12 | 13 | 14 | token-dispatcher-configuration.xml 15 | 16 | 17 | 18 | Timestamp Signature 19 | sctIssuer.properties 20 | 21 | 22 | 23 | 24 | 25 | Timestamp 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/handler/config/Resolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rampart.handler.config; 17 | 18 | /** 19 | * Interface which can be used to resolve variables in the synapse config. 20 | */ 21 | public interface Resolver { 22 | 23 | /** 24 | * Sets the variable to be resolved. 25 | * 26 | * @param input the variable to be set 27 | */ 28 | void setVariable(String input); 29 | /** 30 | * Resolves the variable set by {@link #setVariable(String)}. 31 | * 32 | * @return the resolved value of the variable 33 | */ 34 | String resolve(); 35 | } 36 | -------------------------------------------------------------------------------- /modules/distribution/src.xml: -------------------------------------------------------------------------------- 1 | 2 | src 3 | false 4 | 5 | zip 6 | 7 | 8 | 9 | 10 | ../.. 11 | rampart-src-${rampart.version} 12 | 13 | **/modules/**/* 14 | **/pom.xml 15 | src 16 | release-docs/* 17 | 18 | 19 | **/target 20 | **/target/**/* 21 | **/build 22 | **/build/**/* 23 | **/.settings 24 | **/.classpath 25 | **/.project 26 | **/.wtpmodules 27 | **/*.iml 28 | **/.settings 29 | **/.settings/**/* 30 | **/.svn/** 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLAttributeCallback.java: -------------------------------------------------------------------------------- 1 | package org.apache.rahas.impl.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.apache.rahas.RahasData; 7 | import org.opensaml.saml.common.SAMLObject; 8 | 9 | 10 | @SuppressWarnings({"UnusedDeclaration"}) 11 | public class SAMLAttributeCallback implements SAMLCallback{ 12 | 13 | private List attributes = null; 14 | private RahasData data = null; 15 | 16 | public SAMLAttributeCallback(RahasData data){ 17 | attributes = new ArrayList(); 18 | this.data = data; 19 | } 20 | 21 | public int getCallbackType(){ 22 | return SAMLCallback.ATTR_CALLBACK; 23 | } 24 | 25 | /** 26 | * Overloaded method to support SAML2 27 | * @param attribute SAML2 attribute. 28 | */ 29 | public void addAttributes(org.opensaml.saml.saml2.core.Attribute attribute){ 30 | attributes.add(attribute); 31 | } 32 | 33 | /** 34 | * Get the array of SAML2 attributes. 35 | * @return SAML2 attribute list. 36 | */ 37 | public org.opensaml.saml.saml2.core.Attribute[] getSAML2Attributes(){ 38 | return (org.opensaml.saml.saml2.core.Attribute[])attributes.toArray 39 | (new org.opensaml.saml.saml2.core.Attribute[attributes.size()]); 40 | } 41 | 42 | public RahasData getData() { 43 | return data; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/main/java/org/apache/rampart/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart; 18 | import org.apache.axiom.om.OMElement; 19 | 20 | public class Service { 21 | 22 | public OMElement echo(OMElement elem) { 23 | elem.build(); 24 | elem.detach(); 25 | return elem; 26 | } 27 | 28 | /** 29 | * New service method for testing negative scenario where service throws an exception 30 | * @param element 31 | * @return 32 | * @throws Exception 33 | */ 34 | public OMElement returnError(OMElement element) throws Exception { 35 | throw new Exception("Testing negative scenarios with Apache Rampart. Intentional Exception"); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/handler/config/DefaultResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rampart.handler.config; 17 | 18 | /** 19 | * Default Resolver is the class used in general case where any resolver is not used 20 | */ 21 | public class DefaultResolver implements Resolver { 22 | 23 | private String input; 24 | 25 | /** 26 | * Return the variable passed 27 | * @return input 28 | */ 29 | @Override 30 | public String resolve() { 31 | 32 | return input; 33 | } 34 | 35 | /** 36 | * sets the input value 37 | */ 38 | @Override 39 | public void setVariable(String input) { 40 | this.input = input; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s6.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Encrypt Signature Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | 18 | Encrypt Signature Timestamp 19 | bob 20 | org.apache.axis2.security.PWCallback 21 | DirectReference 22 | http://www.w3.org/2001/04/xmlenc#tripledes-cbc 23 | alice 24 | SKIKeyIdentifier 25 | interop.properties 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/secMtom.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Signature Encrypt Timestamp 12 | org.apache.axis2.security.PWCallback 13 | interop.properties 14 | 15 | 16 | 17 | 18 | 19 | Signature Encrypt Timestamp 20 | bob 21 | org.apache.axis2.security.PWCallback 22 | interop.properties 23 | DirectReference 24 | SKIKeyIdentifier 25 | alice 26 | 27 | //xenc:EncryptedData/xenc:CipherData/xenc:CipherValue 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample02/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample02.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | UsernameToken Timestamp 30 | org.apache.rampart.samples.sample02.PWCBHandler 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample03/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample03.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | UsernameToken 30 | org.apache.rampart.samples.sample03.PWCBHandler 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample03/src/org/apache/rampart/samples/sample03/SimpleService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2003-2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.apache.rampart.samples.sample03; 18 | 19 | import org.apache.axis2.AxisFault; 20 | import org.apache.axis2.context.MessageContext; 21 | import org.apache.axis2.context.OperationContext; 22 | import org.apache.axis2.wsdl.WSDLConstants; 23 | import org.apache.ws.security.WSConstants; 24 | import org.apache.ws.security.WSSecurityEngineResult; 25 | import org.apache.ws.security.WSUsernameTokenPrincipal; 26 | import org.apache.ws.security.handler.WSHandlerConstants; 27 | import org.apache.ws.security.handler.WSHandlerResult; 28 | 29 | import java.util.Vector; 30 | 31 | public class SimpleService { 32 | 33 | public String echo(String arg) { 34 | return arg; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/RampartConfigCallbackHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rampart; 17 | 18 | import org.apache.rampart.policy.model.RampartConfig; 19 | 20 | /** 21 | * Callback handler interface to update Rampart Configuration dynamically. Updater class should 22 | * implement this interface and should be registered using the Rampart Configuration as below. 23 | * 24 | * Example: 25 | *
26 |  *   
27 |  *   o.a.r.ConfigUpdater
28 |  *    ...
29 |  *   
30 |  *  
31 | */ 32 | 33 | public interface RampartConfigCallbackHandler { 34 | 35 | public void update(RampartConfig rampartConfig); 36 | 37 | } -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s4.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Signature Encrypt Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | 18 | Signature Encrypt Timestamp 19 | bob 20 | org.apache.axis2.security.PWCallback 21 | SKIKeyIdentifier 22 | EmbeddedKeyName 23 | http://www.w3.org/2001/04/xmlenc#tripledes-cbc 24 | interop.properties 25 | org.apache.axis2.security.PWCallback 26 | SessionKey 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample08/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample08.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Signature Signature 30 | org.apache.rampart.samples.sample08.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/commons-logging.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | # This is the logging properties that goes to the war, there are two logging conf kept at the 21 | # svn, one for developement (one at src/test-resources) and other for producation 22 | 23 | # Uncomment the next line to disable all logging. 24 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog 25 | 26 | # Uncomment the next line to enable the simple log based logging 27 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog 28 | 29 | # Uncomment the next line to enable log4j based logging 30 | org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 31 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/java/commons-logging.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | # This is the logging properties that goes to the war, there are two logging conf kept at the 21 | # svn, one for developement (one at src/test-resources) and other for producation 22 | 23 | # Uncomment the next line to disable all logging. 24 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog 25 | 26 | # Uncomment the next line to enable the simple log based logging 27 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog 28 | 29 | # Uncomment the next line to enable log4j based logging 30 | org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 31 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/commons-logging.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | # This is the logging properties that goes to the war, there are two logging conf kept at the 21 | # svn, one for developement (one at src/test-resources) and other for producation 22 | 23 | # Uncomment the next line to disable all logging. 24 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog 25 | 26 | # Uncomment the next line to enable the simple log based logging 27 | org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog 28 | 29 | # Uncomment the next line to enable log4j based logging 30 | #org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 31 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s7.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Signature Encrypt Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | interop.properties 14 | 15 | 16 | 17 | 18 | 19 | Signature Encrypt Timestamp 20 | bob 21 | org.apache.axis2.security.PWCallback 22 | DirectReference 23 | http://www.w3.org/2001/04/xmlenc#tripledes-cbc 24 | alice 25 | SKIKeyIdentifier 26 | interop.properties 27 | interop.properties 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/Header.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.ws.secpolicy.model; 18 | 19 | public class Header { 20 | 21 | private String name; 22 | private String namespace; 23 | 24 | /** 25 | * @return Returns the name. 26 | */ 27 | public String getName() { 28 | return name; 29 | } 30 | /** 31 | * @param name The name to set. 32 | */ 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | /** 37 | * @return Returns the namespace. 38 | */ 39 | public String getNamespace() { 40 | return namespace; 41 | } 42 | /** 43 | * @param namespace The namespace to set. 44 | */ 45 | public void setNamespace(String namespace) { 46 | this.namespace = namespace; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/complete.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Timestamp Signature Encrypt 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | 14 | 15 | 16 | 17 | 18 | Timestamp Signature Encrypt 19 | bob 20 | org.apache.axis2.security.PWCallback 21 | interop.properties 22 | SKIKeyIdentifier 23 | SKIKeyIdentifier 24 | alice 25 | {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp 26 | 27 | //xenc:EncryptedData/xenc:CipherData/xenc:CipherValue 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/security/s3.service.xml: -------------------------------------------------------------------------------- 1 | 2 | org.apache.axis2.oasis.ping.PingPortSkeleton 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Signature Encrypt Timestamp 11 | org.apache.axis2.security.PWCallback 12 | interop.properties 13 | false 14 | 15 | 16 | 17 | 18 | 19 | Signature Encrypt Timestamp 20 | bob 21 | org.apache.axis2.security.PWCallback 22 | interop.properties 23 | DirectReference 24 | SKIKeyIdentifier 25 | http://www.w3.org/2001/04/xmlenc#tripledes-cbc 26 | alice 27 | false 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/samples/msgs/req01.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2008-06-23T13:17:13.841Z 6 | 2008-06-23T13:22:13.841Z 7 | 8 | 9 | alice 10 | bobPW 11 | 12 | 13 | http://localhost:8081/axis2/services/sample01 14 | urn:uuid:AEDBA74A8D1FC94B631214227032877 15 | urn:echo 16 | 17 | 18 | 19 | Hello world 20 | 21 | 22 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy/SecurityPolicyBindingsSymm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample02/src/org/apache/rampart/samples/sample02/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample02; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("bob".equals(id)) { 35 | pwcb.setPassword("bobPW"); 36 | } 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /modules/rampart-policy/src/main/java/org/apache/ws/secpolicy/model/AbstractConfigurableSecurityAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2004 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.ws.secpolicy.model; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import org.apache.neethi.Assertion; 22 | 23 | public abstract class AbstractConfigurableSecurityAssertion extends AbstractSecurityAssertion { 24 | 25 | protected ArrayList configurations = null; 26 | 27 | public void addConfiguration(Assertion assertion) { 28 | if (configurations == null) { 29 | configurations = new ArrayList(); 30 | } 31 | configurations.add(assertion); 32 | } 33 | 34 | public List getConfigurations() { 35 | return configurations; 36 | } 37 | 38 | public Assertion getDefaultAssertion() { 39 | if (configurations != null) { 40 | return (Assertion) configurations.get(0); 41 | } 42 | return null; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy-transport-binding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample02/src/org/apache/rampart/samples/policy/sample02/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample02; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample03/src/org/apache/rampart/samples/policy/sample03/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample03; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample04/src/org/apache/rampart/samples/policy/sample04/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample04; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample05/src/org/apache/rampart/samples/policy/sample05/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample05; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample08/src/org/apache/rampart/samples/policy/sample08/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample08; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample04/src/org/apache/rampart/samples/sample04/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample04; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample05/src/org/apache/rampart/samples/sample05/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample05; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample06/src/org/apache/rampart/samples/sample06/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample06; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample07/src/org/apache/rampart/samples/sample07/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample07; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample08/src/org/apache/rampart/samples/sample08/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample08; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample10/src/org/apache/rampart/samples/sample10/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample10; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample11/src/org/apache/rampart/samples/sample11/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample11; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | 34 | String id = pwcb.getIdentifer(); 35 | if("client".equals(id)) { 36 | pwcb.setPassword("apache"); 37 | } else if("service".equals(id)) { 38 | pwcb.setPassword("apache"); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /orbit/pom.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | org.apache.rampart 22 | rampart-project 23 | 1.7.0-wso2v8-SNAPSHOT 24 | ../pom.xml 25 | 26 | 27 | 4.0.0 28 | org.apache.rampart.wso2 29 | rampart-orbit 30 | pom 31 | Rampart-Orbit 32 | org.apache.rampart 33 | http://www.wso2.com 34 | 1.7.0-wso2v8-SNAPSHOT 35 | 36 | 37 | rampart-core 38 | rampart-trust 39 | rampart-policy 40 | 41 | 42 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample-tomcat/policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | alice 33 | org.apache.rampart.tomcat.sample.PWCBHandler 34 | 35 | build/client.jks 36 | apache 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy-asymm-binding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /release-docs/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample05/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample05.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Encrypt 30 | org.apache.rampart.samples.sample05.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Encrypt 38 | client 39 | service.properties 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /modules/rampart-samples/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/handler/config/SystemResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rampart.handler.config; 17 | 18 | /** 19 | * System resolver can be used to resolve environment variables in the synapse config. 20 | */ 21 | public class SystemResolver implements Resolver { 22 | 23 | private String input; 24 | 25 | /** 26 | * set environment variable which needs to resolved 27 | **/ 28 | @Override 29 | public void setVariable(String input) { 30 | this.input = input; 31 | } 32 | 33 | /** 34 | * environment variable is resolved in this function 35 | * @return resolved value for the environment variable 36 | */ 37 | @Override 38 | public String resolve() { 39 | String envValue = System.getenv(input); 40 | if (envValue == null) { 41 | throw new IllegalArgumentException("Environment variable could not be found for " + input + ". " + 42 | "Please ensure that the environment variable is set before using it in the configuration."); 43 | } 44 | return envValue; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample06/src/org/apache/rampart/samples/policy/sample06/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample06; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | } else if("sts".equals(id)) { 39 | pwcb.setPassword("apache"); 40 | } 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy/SecurityPolicyBindings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample07/src/org/apache/rampart/samples/policy/sample07/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample07; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 33 | String id = pwcb.getIdentifer(); 34 | if("client".equals(id)) { 35 | pwcb.setPassword("apache"); 36 | } else if("service".equals(id)) { 37 | pwcb.setPassword("apache"); 38 | }else if("client2".equals(id)) { 39 | pwcb.setPassword("apache"); 40 | } 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/PolicyValidatorCallbackHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.apache.rampart; 17 | 18 | import java.util.Vector; 19 | 20 | /** 21 | * Callback handler interface to allow different implementations of policy based results validation. 22 | * Default implementation is org.apache.rampart.PolicyBasedResultsValidator. 23 | * Custom implementations could be provided in rampart config as shown in below example. 24 | * 25 | * Example: 26 | *
27 |  *   
28 |  *   xx.yy.CustomPolicyValidator
29 |  *    ...
30 |  *   
31 |  *  
32 | */ 33 | 34 | public interface PolicyValidatorCallbackHandler { 35 | /** 36 | * Validate policy based results. 37 | * 38 | * @param data validator data 39 | * @param results policy based ws-security results 40 | * @throws RampartException Rampart exception 41 | */ 42 | public abstract void validate(ValidatorData data, Vector results) throws RampartException; 43 | 44 | } -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample04/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample04.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Signature 30 | service.properties 31 | 32 | 33 | 34 | 35 | 36 | Timestamp Signature 37 | service 38 | org.apache.rampart.samples.sample04.PWCBHandler 39 | service.properties 40 | DirectReference 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample06/mex_policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy/soapmessage-no-wss-header.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | 35 | 1001 36 | 37 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample09/src/org/apache/rampart/samples/sample09/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample09; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | private static final byte[] key = { 30 | 31 | (byte) 0x31, (byte) 0xfd, (byte) 0xcb, (byte) 0xda, (byte) 0xfb, 32 | 33 | (byte) 0xcd, (byte) 0x6b, (byte) 0xa8, (byte) 0xe6, (byte) 0x19, 34 | 35 | (byte) 0xa7, (byte) 0xbf, (byte) 0x51, (byte) 0xf7, (byte) 0xc7, 36 | 37 | (byte) 0x3e }; 38 | 39 | public void handle(Callback[] callbacks) throws IOException, 40 | UnsupportedCallbackException { 41 | for (int i = 0; i < callbacks.length; i++) { 42 | WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i]; 43 | 44 | if (pwcb.getUsage() == WSPasswordCallback.KEY_NAME) { 45 | pwcb.setKey(key); 46 | } 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/samples/policy/sample02.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/README.txt: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | **************************** Apache Rampart Samples **************************** 3 | ******************************************************************************** 4 | 5 | This is a set of Apache Rampart samples which uses configuraiton parameters 6 | to configure rampart. 7 | 8 | Each "sampleX" directory contains : 9 | 10 | - client.axis2.xml - Client configuration 11 | - services.xml - Service configuration 12 | - src - Source of the sample 13 | - README.txt - you have to read this :-) 14 | 15 | We use two parameters named "InflowSecurity" and "OutflowSecurity" within 16 | these files to configure rampart. 17 | 18 | 01.) Rampart Engaged and no configuration 19 | 02.) UsernameToken authentication 20 | 03.) UsernameToken authentication with a plain text password 21 | 04.) Message integrity and non-repudiation with signature 22 | 05.) Encryption 23 | 06.) Sign and encrypt a messages 24 | 07.) Encrypt and sign messages 25 | 08.) Signing twice 26 | 09.) Encryption with a key known to both parties 27 | 10.) MTOM Optimizing base64 content in the secured message 28 | 11.) Dynamic configuration : Get rid of the config files ... let's use code! 29 | 30 | You can use the ant build script provided here to run these samples. 31 | 32 | Exmaple: Running sample - 01 33 | - Start two shell instnaces and change to the directory where this file is 34 | - To start the service: 35 | $ ant service.01 36 | - To run client: 37 | $ ant client.01 38 | 39 | -------------------------------------------------------------------------------- 40 | NOTE: To view the messages exchanged 41 | - Change the "client.port" property in the "build.xml" to an available port 42 | E.g. : 43 | - Setup tcpmon (http://ws.apache.org/commons/tcpmon/) to listen on the above 44 | port and to point to port 8080 (value of the service.port property) -------------------------------------------------------------------------------- /modules/rampart-core/src/main/java/org/apache/rampart/policy/SupportingPolicyData.java: -------------------------------------------------------------------------------- 1 | package org.apache.rampart.policy; 2 | 3 | import java.util.Iterator; 4 | 5 | import org.apache.ws.secpolicy.model.Header; 6 | import org.apache.ws.secpolicy.model.SupportingToken; 7 | 8 | public class SupportingPolicyData extends RampartPolicyData { 9 | 10 | public void build(SupportingToken token) { 11 | 12 | if (token.getSignedParts() != null && !token.getSignedParts().isOptional()) { 13 | Iterator it = token.getSignedParts().getHeaders().iterator(); 14 | this.setSignBody(token.getSignedParts().isBody()); 15 | while (it.hasNext()) { 16 | Header header = (Header) it.next(); 17 | this.addSignedPart(header.getNamespace(), header.getName()); 18 | } 19 | } 20 | 21 | if (token.getEncryptedParts() != null && !token.getEncryptedParts().isOptional()) { 22 | Iterator it = token.getEncryptedParts().getHeaders().iterator(); 23 | this.setEncryptBody(token.getEncryptedParts().isBody()); 24 | while (it.hasNext()) { 25 | Header header = (Header) it.next(); 26 | this.setEncryptedParts(header.getNamespace(), header.getName(), 27 | "Header"); 28 | } 29 | } 30 | 31 | if (token.getSignedElements() != null && !token.getSignedElements().isOptional()) { 32 | Iterator it = token.getSignedElements().getXPathExpressions() 33 | .iterator(); 34 | while (it.hasNext()) { 35 | this.setSignedElements((String) it.next()); 36 | } 37 | this.addDeclaredNamespaces(token.getSignedElements() 38 | .getDeclaredNamespaces()); 39 | } 40 | 41 | if (token.getEncryptedElements() != null && !token.getEncryptedElements().isOptional()) { 42 | Iterator it = token.getEncryptedElements().getXPathExpressions() 43 | .iterator(); 44 | while (it.hasNext()) { 45 | this.setEncryptedElements((String) it.next()); 46 | } 47 | if (token.getSignedElements() == null) { 48 | this.addDeclaredNamespaces(token.getEncryptedElements() 49 | .getDeclaredNamespaces()); 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample-tomcat/README: -------------------------------------------------------------------------------- 1 | ******************************************************************************** 2 | **************************** Apache Rampart Tomcat Samples ********************* 3 | ******************************************************************************** 4 | 5 | It is strongly recommended to run other samples before trying this. Because it will create the directory structure to expected by the build file. 6 | 7 | UsernameToken Authentication over HTTPS. 8 | 9 | Step1: Install Axis2 in Tomcat by reading the Axis2 installation guide available in http://ws.apache.org/axis2/. Then test axis2 in Tomcat. 10 | 11 | Step2: Copy keystores into Tomcat by giving the following command in this directory. 12 | $ant copy.keys 13 | 14 | Step3: Copy rampart jars and mars into Tomcat by giving the following command in this directory. 15 | $ant copy.rampart.to.tomcat 16 | 17 | Step4: Enable HTTPS on Tomcat. For Tomcat5 uncomment the "SSL HTTP/1.1 Connector". The default HTTPS port for Tomcat is 8443. For more information "http://tomcat.apache.org/tomcat-5.0-doc/ssl-howto.html" 18 | 19 | Step5: Add the key store information by adding the following into the Connector element in server.xml. 20 | 21 | truststoreFile="rampart-sample-keys.jks" 22 | truststorePass="apache" 23 | truststoreType="JKS" 24 | keystoreFile="rampart-sample-keys.jks" 25 | keystorePass="apache" 26 | 27 | Start tomcat and check the service by typing "https://127.0.0.1:8443/axis2/services/listServices" in the browser. If you have changed the SSL port then type the correct port number and please change the build.xml's ssl.port accordingly. 28 | 29 | Step6: The following command will copy the ut-over-https.aar into the ${CATALINA_HOME}/webapps/axis2/WEB-INF/services/ut-over-https.aar 30 | $ant create.and.copy.service 31 | 32 | Step7: Start tomcat. View https://127.0.0.1:8443/axis2/services/listServices to see wether the service is available. 33 | 34 | Step8: The following command will create and run the client. 35 | $ant create.and.run.client 36 | 37 | 38 | -------------------------------------------------------------------------------- /modules/rampart-extensions/jpam-callback-handler/src/main/java/org/apache/rampart/extensions/jpam/JPAMCallbackHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import org.apache.ws.security.WSPasswordCallback; 18 | 19 | import javax.security.auth.callback.Callback; 20 | import javax.security.auth.callback.CallbackHandler; 21 | import javax.security.auth.callback.UnsupportedCallbackException; 22 | 23 | import java.io.IOException; 24 | 25 | import net.sf.jpam.Pam; 26 | import net.sf.jpam.PamReturnValue; 27 | 28 | public class JPAMCallbackHandler implements CallbackHandler { 29 | 30 | public void handle(Callback[] callbacks) throws IOException, 31 | UnsupportedCallbackException { 32 | for (int i = 0; i < callbacks.length; i++) { 33 | // When the server side need to authenticate the user 34 | WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i]; 35 | if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) { 36 | Pam pam = new Pam(); 37 | PamReturnValue ret = pam.authenticate(pwcb.getIdentifer(), pwcb 38 | .getPassword()); 39 | if (ret.equals(PamReturnValue.PAM_SUCCESS)) { 40 | return; 41 | } else { 42 | throw new IOException("check failed"); 43 | } 44 | 45 | } 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /modules/documentation/src/site/resources/samples/policy/sample03.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample09/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample09.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Encrypt 30 | org.apache.rampart.samples.sample09.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Encrypt 38 | service 39 | EmbeddedKeyName 40 | service.properties 41 | org.apache.rampart.samples.sample09.PWCBHandler 42 | SessionKey 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/services-13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.apache.rampart.Service 7 | 8 | 9 | 10 | urn:echo 11 | 12 | 13 | 14 | 15 | urn:returnError 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.apache.rampart.PWCallback 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample-tomcat/src/org/apache/rampart/tomcat/sample/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.tomcat.sample; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | 33 | //When the server side need to authenticate the user 34 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 35 | if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) { 36 | if(pwcb.getIdentifer().equals("alice") && pwcb.getPassword().equals("bobPW")) { 37 | return; 38 | } else { 39 | throw new UnsupportedCallbackException(callbacks[i], "check failed"); 40 | } 41 | } 42 | 43 | //When the client requests for the password to be added in to the 44 | //UT element 45 | pwcb.setPassword("bobPW"); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /modules/rampart-mar/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | This module provides the WS-Security and WS-SecureConversation 4 | functionalities for Axis2, based on Apache WSS4J, Apache XML-Security 5 | and Apache Rahas implementations. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/rampart-samples/policy/sample01/src/org/apache/rampart/samples/policy/sample01/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.policy.sample01; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | for (int i = 0; i < callbacks.length; i++) { 32 | 33 | //When the server side need to authenticate the user 34 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 35 | if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) { 36 | if(pwcb.getIdentifer().equals("alice") && pwcb.getPassword().equals("bobPW")) { 37 | return; 38 | } else { 39 | throw new UnsupportedCallbackException(callbacks[i], "check failed"); 40 | } 41 | } 42 | 43 | //When the client requests for the password to be added in to the 44 | //UT element 45 | pwcb.setPassword("bobPW"); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/AxiomParserPool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.rahas.impl.util; 20 | 21 | import net.shibboleth.utilities.java.support.xml.BasicParserPool; 22 | import javax.xml.parsers.DocumentBuilderFactory; 23 | import java.lang.reflect.Field; 24 | 25 | /** 26 | * Custom OpenSAML 1.x {@link ParserPool} implementation that uses a DOM aware Axiom implementation 27 | * instead of requesting a {@link DocumentBuilderFactory} using JAXP. 28 | */ 29 | public class AxiomParserPool extends BasicParserPool { 30 | public AxiomParserPool() { 31 | DocumentBuilderFactory dbf = new DOOMDocumentBuilderFactory(); 32 | 33 | // Unfortunately, ParserPool doesn't allow to set the DocumentBuilderFactory, so that we 34 | // have to use reflection here. 35 | try { 36 | Field dbfField = BasicParserPool.class.getDeclaredField("builderFactory"); 37 | dbfField.setAccessible(true); 38 | dbfField.set(this, dbf); 39 | } catch (IllegalAccessException ex) { 40 | throw new IllegalAccessError(ex.getMessage()); 41 | } catch (NoSuchFieldException ex) { 42 | throw new NoSuchFieldError(ex.getMessage()); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /modules/rampart-tests/src/test/java/org/apache/rampart/SecurityTokenReferenceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2015 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart; 18 | 19 | import junit.framework.Assert; 20 | import junit.framework.TestCase; 21 | import org.apache.rahas.TrustUtil; 22 | import org.w3c.dom.Document; 23 | import org.w3c.dom.Element; 24 | 25 | import javax.xml.parsers.DocumentBuilderFactory; 26 | import javax.xml.parsers.ParserConfigurationException; 27 | import java.util.UUID; 28 | 29 | public class SecurityTokenReferenceTest extends TestCase { 30 | 31 | public void testSecurityTokenReference() { 32 | 33 | try { 34 | Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); 35 | Element strElem = TrustUtil.createSecurityTokenReferenceWithTokenType(doc, UUID.randomUUID().toString(), 36 | "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID", "http://docs.oasis-open" + 37 | ".org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"); 38 | System.out.println(strElem.getAttribute("wsse11:TokenType")); 39 | Assert.assertEquals("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0", strElem 40 | .getAttribute("wsse11:TokenType")); 41 | } catch (ParserConfigurationException e) { 42 | e.printStackTrace(); 43 | fail(e.getMessage()); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample07/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample07.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Encrypt Signature 30 | org.apache.rampart.samples.sample07.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Timestamp Encrypt Signature 38 | service 39 | org.apache.rampart.samples.sample07.PWCBHandler 40 | service.properties 41 | DirectReference 42 | SKIKeyIdentifier 43 | useReqSigCert 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/resources/rampart/services-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.apache.rampart.Service 7 | 8 | 9 | 10 | urn:echo 11 | 12 | 13 | 14 | 15 | urn:returnError 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.apache.rampart.PWCallback 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample11/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample11.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Signature Encrypt 30 | org.apache.rampart.samples.sample11.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Timestamp Signature Encrypt 38 | service 39 | org.apache.rampart.samples.sample11.PWCBHandler 40 | service.properties 41 | DirectReference 42 | SKIKeyIdentifier 43 | useReqSigCert 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample10/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample10.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Signature Encrypt 30 | org.apache.rampart.samples.sample10.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Timestamp Signature Encrypt 38 | service 39 | org.apache.rampart.samples.sample10.PWCBHandler 40 | service.properties 41 | DirectReference 42 | SKIKeyIdentifier 43 | useReqSigCert 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /modules/rampart-tests/test-resources/policy-symm-binding.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample03/src/org/apache/rampart/samples/sample03/PWCBHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rampart.samples.sample03; 18 | 19 | import org.apache.ws.security.WSPasswordCallback; 20 | 21 | import javax.security.auth.callback.Callback; 22 | import javax.security.auth.callback.CallbackHandler; 23 | import javax.security.auth.callback.UnsupportedCallbackException; 24 | 25 | import java.io.IOException; 26 | 27 | public class PWCBHandler implements CallbackHandler { 28 | 29 | public void handle(Callback[] callbacks) throws IOException, 30 | UnsupportedCallbackException { 31 | 32 | for (int i = 0; i < callbacks.length; i++) { 33 | 34 | //When the server side need to authenticate the user 35 | WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i]; 36 | if (pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN_UNKNOWN) { 37 | if(pwcb.getIdentifer().equals("bob") && pwcb.getPassword().equals("bobPW")) { 38 | //If authentication successful, simply return 39 | return; 40 | } else { 41 | throw new UnsupportedCallbackException(callbacks[i], "check failed"); 42 | } 43 | } 44 | 45 | //When the client requests for the password to be added in to the 46 | //UT element 47 | pwcb.setPassword("bobPW"); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /modules/rampart-integration/src/test/java/org/apache/axis2/security/Scenario1Test.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.axis2.security; 18 | 19 | import org.apache.rampart.handler.config.InflowConfiguration; 20 | import org.apache.rampart.handler.config.OutflowConfiguration; 21 | 22 | import java.util.Hashtable; 23 | 24 | 25 | /** 26 | * WS-Security interop scenario 1 27 | */ 28 | public class Scenario1Test extends InteropTestBase { 29 | 30 | 31 | protected OutflowConfiguration getOutflowConfiguration() { 32 | OutflowConfiguration ofc = new OutflowConfiguration(); 33 | ofc.setActionItems("UsernameToken"); 34 | ofc.setUser("Chris"); 35 | ofc.setPasswordCallbackClass("org.apache.axis2.security.PWCallback"); 36 | ofc.setPasswordType("PasswordText"); 37 | return ofc; 38 | } 39 | 40 | protected InflowConfiguration getInflowConfiguration() { 41 | return null; 42 | } 43 | 44 | protected String getClientRepo() { 45 | return SCENARIO1_CLIENT_REPOSITORY; 46 | } 47 | 48 | protected String getServiceRepo() { 49 | return SCENARIO1_SERVICE_REPOSITORY; 50 | } 51 | 52 | protected boolean isUseSOAP12InStaticConfigTest() { 53 | return true; 54 | } 55 | 56 | protected OutflowConfiguration getOutflowConfigurationWithRefs() { 57 | return null; 58 | } 59 | 60 | protected InflowConfiguration getInflowConfigurationWithRefs() { 61 | return null; 62 | } 63 | 64 | protected Hashtable getPropertyRefs() { 65 | return null; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /modules/rampart-samples/basic/sample06/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | org.apache.rampart.samples.sample06.SimpleService 24 | 25 | 26 | 27 | 28 | 29 | Timestamp Signature Encrypt 30 | org.apache.rampart.samples.sample06.PWCBHandler 31 | service.properties 32 | 33 | 34 | 35 | 36 | 37 | Timestamp Signature Encrypt 38 | service 39 | org.apache.rampart.samples.sample06.PWCBHandler 40 | service.properties 41 | DirectReference 42 | SKIKeyIdentifier 43 | useReqSigCert 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /modules/rampart-trust/sts-aar-resources/saml-issuer-config.xml: -------------------------------------------------------------------------------- 1 | 2 | Test_STS 3 | 4 | 5 | ip 6 | 7 | 8 | password 9 | 10 | 11 | 12 | JKS 13 | META-INF/rahas-sts.jks 14 | password 15 | 16 | 17 | 18 | 300000 19 | 20 | 256 21 | 22 | 23 | 24 | 25 | 31 | 2 32 | 33 | 39 | BinarySecret 40 | 41 | 42 | 43 | http://localhost:8080/axis2/services/STS 44 | 45 | 51 | 55 | 56 | -------------------------------------------------------------------------------- /modules/rampart-tests/src/test/java/org/apache/rahas/TempIssuer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004,2005 The Apache Software Foundation. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.apache.rahas; 18 | 19 | import org.apache.axiom.om.OMElement; 20 | import org.apache.axiom.soap.SOAPEnvelope; 21 | 22 | public class TempIssuer implements TokenIssuer { 23 | 24 | /* (non-Javadoc) 25 | * @see org.apache.rahas.TokenIssuer#setConfigurationFile(java.lang.String) 26 | */ 27 | public void setConfigurationFile(String configFile) { 28 | } 29 | 30 | /* (non-Javadoc) 31 | * @see org.apache.rahas.TokenIssuer#setConfigurationElement(org.apache.axiom.om.OMElement) 32 | */ 33 | public void setConfigurationElement(OMElement configElement) { 34 | } 35 | 36 | /* (non-Javadoc) 37 | * @see org.apache.rahas.TokenIssuer#setConfigurationParamName(java.lang.String) 38 | */ 39 | public void setConfigurationParamName(String configParamName) { 40 | } 41 | 42 | /* (non-Javadoc) 43 | * @see org.apache.rahas.TokenIssuer#issue(org.apache.rahas.RahasData) 44 | */ 45 | public SOAPEnvelope issue(RahasData data) throws TrustException { 46 | // TODO TODO 47 | throw new UnsupportedOperationException("TODO"); 48 | } 49 | 50 | /* (non-Javadoc) 51 | * @see org.apache.rahas.TokenIssuer#getResponseAction(org.apache.rahas.RahasData) 52 | */ 53 | public String getResponseAction(RahasData data) throws TrustException { 54 | // TODO TODO 55 | throw new UnsupportedOperationException("TODO"); 56 | } 57 | 58 | } 59 | --------------------------------------------------------------------------------