Skip to content

Instantly share code, notes, and snippets.

View darranl's full-sized avatar

Darran Lofthouse darranl

View GitHub Profile
@darranl
darranl / domain.sh
Created March 16, 2011 12:20
Sample Two Node Domain
#!/bin/sh
DIRNAME=`dirname $0`
PROGNAME=`basename $0`
GREP="grep"
# Use the maximum available, or set MAX_FD != -1 to use that
MAX_FD="maximum"
#
@darranl
darranl / XML_Snippets.xml
Created December 15, 2011 18:25
Sample SSL Configurations for AS7
* SSL System Properties *
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=/home/darranl/src/ide/eclipse/as7/remoting-standalone/client.truststore -Djavax.net.ssl.trustStorePassword=truststore_password"
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.keyStore=/home/darranl/src/ide/eclipse/as7/remoting-standalone/client.keystore -Djavax.net.ssl.keyStorePassword=keystore_password"
* Original *
<management>
<security-realms>
<security-realm name="ManagementRealm">
@darranl
darranl / AA-Notes.txt
Created December 20, 2011 17:34
Sample Remote EJB3 Security Files
AS7 Development Branch
https://github.com/darranl/jboss-as/tree/ejb_remoting_security
Quickstart Branch
https://github.com/darranl/quickstart/tree/ejb_remote_security
EJB Client Branch
@darranl
darranl / createHA1
Created May 29, 2013 14:31
Digest Code Snippets
private byte[] createHA1(final byte[] userName, final Account account, final MessageDigest digest,
final DigestAlgorithm digestAlgorithm) throws AuthenticationException {
if (plainTextPasswords) {
char[] attribute = (char[]) account.getAttribute(Account.PLAINTEXT_PASSWORD_ATTRIBUTE);
if(attribute == null) {
return null;
}
byte[] password = new String(attribute).getBytes(UTF_8);
try {
@darranl
darranl / explicit.dmr
Last active December 22, 2015 22:19
Illustration of use-realm-roles configuration.
"role-mapping" => {
"Monitor" => {
"exclude" => undefined,
"include" => {"group-Monitor" => {
"name" => "Monitor",
"realm" => undefined,
"type" => "GROUP"
}}
},
"Operator" => {
@darranl
darranl / Existing Mapping.json
Last active December 23, 2015 00:19
Role Mapping - Adding All
"role-mapping" => {
"Monitor" => {
"exclude" => {
"user-username" => {
"name" => "username",
"realm" => undefined,
"type" => "USER"
},
"user-username@realmname" => {
"name" => "username",
@darranl
darranl / invalidate
Created November 5, 2014 16:48
Microsoft SQL Server JDBC Driver Stack Traces
Daemon Thread [http-/127.0.0.1:8080-1] (Suspended (breakpoint at line 614 in KerberosTicket))
owns: Object (id=345)
Krb5InitCredential(KerberosTicket).destroy() line: 614 [local variables unavailable]
Krb5InitCredential.dispose() line: 296
GSSCredentialImpl.dispose() line: 119
KerbAuthentication.ReleaseClientContext() line: 277
SQLServerConnection.logon(SQLServerConnection$LogonCommand) line: 2254
SQLServerConnection.access$000(SQLServerConnection, SQLServerConnection$LogonCommand) line: 41
SQLServerConnection$LogonCommand.doExecute() line: 2220
SQLServerConnection$LogonCommand(TDSCommand).execute(TDSWriter, TDSReader) line: 5696
@darranl
darranl / commands.txt
Last active August 29, 2015 14:20
Elytron CLI Commands
# KeyStore Commands
./subsystem=elytron/keystore=test:add(type=jks, path=/home/darranl/src/wildfly9/elytron-testing/test.keystore, password=keystore_password)
# Provider Loader Commands
./subsystem=elytron/provider-loader=y:add(register=false, providers=[ {load-services=true, module=org.jboss.sasl}, {load-services=false, module=org.wildfly.security.elytron, class-names=[org.wildfly.security.password.impl.WildFlyElytronPasswordProvider] } ]
If NSS is backed by a SQL database the following environment variable should be exported first: -
export NSS_DEFAULT_DB_TYPE=sql
public interface SecurityRealm {
RealmIdentity createRealmIdentity(String name) throws RealmUnavailableException;
CredentialSupport getCredentialSupport(Class<?> credentialType, String algorithmName) throws RealmUnavailableException;
}
17:59:03,681 INFO (main) [TEST] doBefore <ChannelTestBase.java:85> Running test testRefused
Exception is: java.net.ConnectException: Connection refused
17:59:03,878 INFO (main) [TEST] doAfter <ChannelTestBase.java:92> Finished test testRefused
17:59:03,899 INFO (main) [TEST] doBefore <ChannelTestBase.java:85> Running test testEmptyMessage
Message received
17:59:04,045 INFO (main) [TEST] doAfter <ChannelTestBase.java:92> Finished test testEmptyMessage
17:59:04,058 INFO (main) [TEST] doBefore <ChannelTestBase.java:85> Running test testLotsOfContent
Message received
17:59:04,190 INFO (main) [TEST] doAfter <ChannelTestBase.java:92> Finished test testLotsOfContent
17:59:04,207 INFO (main) [TEST] doBefore <ChannelTestBase.java:85> Running test testWriteCancel