wildfly/wildfly — pull request #5983 by darranl (2014-03-04 14:45:29+00:00)
Title: [WFLY-2581] API for EJB Security Interceptor QuickStarts

This change has actually resulted in two different aspects of a public API, the nature of this area means we can very quickly get into circular dependencies.

1 - Parent interfaces have been added for the Principal implementations for the Principals that represent users and groups.

Existing code that is referencing children will still work as this classes still exist, the only modification being the new interfaces higher up the hierarchy - future code can then use these interfaces from the new public module.

2 - Interceptor code was previously accessing the Remoting connection, obtaining the Principals form that connection, calling the security APIs to push a new identity and clearing the connection associated with the thread.

This has now been wrapped into a 'ConnectionSecurityContext' class which now performs the majority of this work, server side interceptors are no longer even aware the connection type is Remoting so can pull the credentials, push a new identity (which does a lot of the work for the calling interceptor), the interceptor can also call pop to restore the previous state before it called push.

The ejb-security-plus quick start is now modified to work with these changes, just need to switch ejb-security-interceptors over but both were following the same approach: -
https://github.com/darranl/wildfly-quickstart/tree/security_interceptors