SecurityIdentity(final SecurityIdentity old, final IdentityCredentials credentials, final boolean isPrivate) { this.securityDomain = old.securityDomain; this.principal = old.principal; this.realmInfo = old.realmInfo; this.authorizationIdentity = old.authorizationIdentity; this.defaultRoles = old.defaultRoles; this.roleMappers = old.roleMappers; this.creationTime = old.creationTime; this.verifier = old.verifier; this.publicCredentials = isPrivate ? old.publicCredentials : old.publicCredentials.with(credentials); this.privateCredentials = isPrivate ? old.privateCredentials.with(credentials) : old.privateCredentials; this.withSuppliedIdentities = old.withSuppliedIdentities; this.withIdentities = old.withIdentities; }
public CredentialSource with(final CredentialSource other) { return other instanceof IdentityCredentials ? with((IdentityCredentials) other) : super.with(other); }
public IdentityCredentials with(final IdentityCredentials other) { Assert.checkNotNullParam("other", other); if (other == NONE) { return this; } else if (other instanceof One) { return withCredential(((One) other).credential); } else { return other.with(this); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
private static AuthenticationConfiguration initializeConfiguration(final URI uri, AuthenticationConfiguration configuration) { final SecurityDomain authenticationNameForwardSecurityDomain = configuration.authenticationNameForwardSecurityDomain; final String userInfo = uri.getUserInfo(); if (userInfo != null && configuration.getPrincipal() == AnonymousPrincipal.getInstance() && authenticationNameForwardSecurityDomain == null) { configuration = configuration.useName(userInfo); } // capture forwards if (authenticationNameForwardSecurityDomain != null) { configuration = configuration.useForwardedAuthenticationIdentity(null).usePrincipal(authenticationNameForwardSecurityDomain.getCurrentSecurityIdentity().getPrincipal()); } final SecurityDomain authenticationCredentialsForwardSecurityDomain = configuration.authenticationCredentialsForwardSecurityDomain; if (authenticationCredentialsForwardSecurityDomain != null) { final SecurityIdentity securityIdentity = authenticationCredentialsForwardSecurityDomain.getCurrentSecurityIdentity(); final IdentityCredentials privateCredentials = securityIdentity.getPrivateCredentials(); final IdentityCredentials publicCredentials = securityIdentity.getPublicCredentials(); // private overrides public configuration = configuration.useForwardedAuthenticationCredentials(null).useCredentials(publicCredentials.with(privateCredentials)); } final SecurityDomain authorizationNameForwardSecurityDomain = configuration.authorizationNameForwardSecurityDomain; if (authorizationNameForwardSecurityDomain != null) { configuration = configuration.useForwardedAuthorizationIdentity(null).useAuthorizationPrincipal(authorizationNameForwardSecurityDomain.getCurrentSecurityIdentity().getPrincipal()); } final AccessControlContext capturedContext = configuration.getCapturedContext(); if (capturedContext == null) { configuration = configuration.withCapturedAccessControlContext(); } return configuration; }
SecurityIdentity(final SecurityIdentity old, final IdentityCredentials credentials, final boolean isPrivate) { this.securityDomain = old.securityDomain; this.principal = old.principal; this.realmInfo = old.realmInfo; this.authorizationIdentity = old.authorizationIdentity; this.roleMappers = old.roleMappers; this.creationTime = old.creationTime; this.verifier = old.verifier; this.publicCredentials = isPrivate ? old.publicCredentials : old.publicCredentials.with(credentials); this.privateCredentials = isPrivate ? old.privateCredentials.with(credentials) : old.privateCredentials; this.withSuppliedIdentities = old.withSuppliedIdentities; this.withIdentities = old.withIdentities; }
SecurityIdentity(final SecurityIdentity old, final IdentityCredentials credentials, final boolean isPrivate) { this.securityDomain = old.securityDomain; this.principal = old.principal; this.realmInfo = old.realmInfo; this.authorizationIdentity = old.authorizationIdentity; this.defaultRoles = old.defaultRoles; this.roleMappers = old.roleMappers; this.creationTime = old.creationTime; this.verifier = old.verifier; this.publicCredentials = isPrivate ? old.publicCredentials : old.publicCredentials.with(credentials); this.privateCredentials = isPrivate ? old.privateCredentials.with(credentials) : old.privateCredentials; this.withSuppliedIdentities = old.withSuppliedIdentities; this.withIdentities = old.withIdentities; }
public CredentialSource with(final CredentialSource other) { return other instanceof IdentityCredentials ? with((IdentityCredentials) other) : super.with(other); }
public CredentialSource with(final CredentialSource other) { return other instanceof IdentityCredentials ? with((IdentityCredentials) other) : super.with(other); }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public IdentityCredentials with(final IdentityCredentials other) { Assert.checkNotNullParam("other", other); if (other == NONE) { return this; } else if (other instanceof One) { return withCredential(((One) other).credential); } else { return other.with(this); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public IdentityCredentials with(final IdentityCredentials other) { Assert.checkNotNullParam("other", other); if (other == NONE) { return this; } else if (other instanceof One) { return withCredential(((One) other).credential); } else { return other.with(this); } }
public IdentityCredentials with(final IdentityCredentials other) { Assert.checkNotNullParam("other", other); if (other == NONE) { return this; } else if (other instanceof One) { return withCredential(((One) other).credential); } else { return other.with(this); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }
public CredentialSource with(final CredentialSource other) { Assert.checkNotNullParam("other", other); if (other instanceof IdentityCredentials) { return with((IdentityCredentials) other); } else { return super.with(other); } }