Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWITCHYARD-2573 cannot deploy demos/security-propagation on WildFly #427

Merged
merged 1 commit into from
Mar 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions demos/security-propagation/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ protected via annotations is also called, and the security context is propagated
Running the quickstart
======================

EAP
----------

1. Create an application user:

${AS}/bin/add-user.sh --user kermit --password the-frog-1 --realm ApplicationRealm --group friend
Expand All @@ -35,6 +38,41 @@ Running the quickstart
cd ../ejb ; mvn clean -Pdeploy


Wildfly
----------


1. Create an application user:

${WILDFLY}/bin/add-user.sh

realm=ApplicationRealm Username=kermit Password=the-frog-1 group=friend

2. Edit the standalone.xml placed on WILDFLY_HOME/standalone/configuration

Remove the default-security-domain tag inside of the ejb3 domain

3. Start Wildfly in standalone mode :

${WILDFLY}/bin/standalone.sh

4. Build and deploy the demo :

cd ejb ; mvn install -Pdeploy -Pwildfly
cd ../basic ; mvn install -Pdeploy -Pwildfly
5. Execute the test. (See "Options" section below.)

6. Check the server console for output from the service.

7. Undeploy the application, then the ejb

mvn clean -Pdeploy -Pwildfly
cd ../ejb ; mvn clean -Pdeploy -Pwildfly

Warning --> Wildfly 8.0.0 When the application is undeployed, it is required to restart the server to get all the undeployment changes done.



Options
=======

Expand Down
5 changes: 5 additions & 0 deletions demos/security-propagation/basic/config_wildfly.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (outcome != success) of /subsystem=undertow/server=default-server/https-listener=https/:read-resource
/core-service=management/security-realm=https:add()
/core-service=management/security-realm=https/server-identity=ssl:add(keystore-path=${jboss.home.dir}/quickstarts/demos/security-propagation/basic/connector.jks, keystore-password=changeit)
/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding=https, security-realm=https)
end-if
8 changes: 6 additions & 2 deletions demos/security-propagation/basic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source>
<version.wildfly.maven>1.0.2.Final</version.wildfly.maven>
<config.file>config.cli</config.file>
<unconfig.file>unconfig.cli</unconfig.file>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -108,7 +110,7 @@
<configuration>
<beforeDeployment>
<scripts>
<script>config.cli</script>
<script>${config.file}</script>
</scripts>
</beforeDeployment>
<filename>${project.build.finalName}.jar</filename>
Expand All @@ -124,7 +126,7 @@
<configuration>
<afterDeployment>
<scripts>
<script>unconfig.cli</script>
<script>${unconfig.file}</script>
</scripts>
</afterDeployment>
<filename>${project.build.finalName}.jar</filename>
Expand Down Expand Up @@ -156,6 +158,8 @@
<id>wildfly</id>
<properties>
<wildfly.port>9990</wildfly.port>
<config.file>config_wildfly.cli</config.file>
<unconfig.file>unconfig_wildfly.cli</unconfig.file>
</properties>
</profile>
</profiles>
Expand Down
4 changes: 4 additions & 0 deletions demos/security-propagation/basic/unconfig_wildfly.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if (outcome == success) of /subsystem=undertow/server=default-server/https-listener=https/:read-resource
/subsystem=undertow/server=default-server/https-listener=https/:remove
/core-service=management/security-realm=https/:remove
end-if
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
package org.switchyard.quickstarts.demo.security.propagation.ejb;

import javax.annotation.Resource;
import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.annotation.security.RolesAllowed;

import org.apache.log4j.Logger;
import org.jboss.ejb3.annotation.SecurityDomain;

@Stateless
@EJB(name = "java:global/TestEJBBean", beanInterface = TestEJBBeanLocal.class)
@RolesAllowed({"friend"})
@SecurityDomain("other")
public class TestEJBBean implements TestEJBBeanLocal {

private static final Logger LOGGER = Logger.getLogger(TestEJBBean.class);
Expand Down