public class JaspicToJaasBridge extends Object
For the most part JASPIC does the authentication itself, and the JASPIC runtime code sets the security context based on that, but in a few cases bridging to JAAS is supported. This is especially the case for JASPIC's PasswordValidationCallback, which is specified to delegate credential validation from JASPIC to the contain/application server's native "identity stores" (realms, login modules, etc).
| Constructor and Description |
|---|
JaspicToJaasBridge() |
| Modifier and Type | Method and Description |
|---|---|
static Subject |
addRealmGroupsToSubject(Subject subject,
String callerPrincipalName,
String realmName) |
static Subject |
jaasX500Login(Subject subject,
X500Principal x500Principal) |
static Subject |
validateUsernamePasswordByJaas(Subject subject,
String username,
char[] password,
String realm)
Performs username/password login validation against a configured JAAS context and realm for JASPIC security.
|
public static Subject validateUsernamePasswordByJaas(Subject subject, String username, char[] password, String realm) throws LoginException
This is used by SAMs that wish to delegate the validation of username/password credentials to a realm installed on the application server (e.g. the LdapRealm). Note that such delegation in pure JASPIC is only defined for the username/password credential.
The difference between this method and the ones in WebAndEjbToJaasBridge is that it just
verifies whether the login will succeed in the given realm. It does not set the result of the
authentication in the appserver runtime environment A silent return from this method means that
the given user succeeding in authenticating with the given password in the given realm
subject - username - password - realm - the realm to authenticate underLoginExceptionpublic static Subject jaasX500Login(Subject subject, X500Principal x500Principal) throws LoginException
LoginExceptionpublic static Subject addRealmGroupsToSubject(Subject subject, String callerPrincipalName, String realmName) throws LoginException
LoginExceptionCopyright © 2019. All rights reserved.