# Batch script to restore the JBEAP configuration that was modified to run the quickstart

# Start batching commands
batch

# Remove the PLAIN mechanism from the application-sasl-authentication factory
/subsystem=elytron/sasl-authentication-factory=application-sasl-authentication:write-attribute(name=mechanism-configurations,value=[{mechanism-name=JBOSS-LOCAL-USER,realm-mapper=local},{mechanism-name=DIGEST-MD5,mechanism-realm-configurations=[{realm-name=ApplicationRealm}]}])

# Remove the remote outbound connection
/subsystem=remoting/http-connector=http-remoting-connector:undefine-attribute(name=sasl-authentication-factory)
/subsystem=remoting/remote-outbound-connection=ejb-outbound-connection:remove

# Remove the outbound socket binding
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=ejb-outbound:remove

# Remove the authentication context and authentication configurations
/subsystem=elytron/authentication-context=ejb-outbound-context:remove
/subsystem=elytron/authentication-configuration=ejb-outbound-configuration:remove

# Remove the application security domain mapping from the EJB3 subsystem
/subsystem=ejb3/application-security-domain=quickstart-domain:remove

# Run the batch commands
run-batch

# Reload the server configuration
reload


