@Override public ProcessingException samlHandlerSignatureNotPresentError() { return new ProcessingException(ErrorCodes.INVALID_DIGITAL_SIGNATURE + "Signature Validation failed. Signature is not present. Check if the IDP is supporting signatures."); }
@Override public ProcessingException samlAssertionRevokedCouldNotRenew(String id) { return new ProcessingException(ErrorCodes.ASSERTION_RENEWAL_EXCEPTION + "SAMLV1.1 Assertion with id " + id + " has been canceled and cannot be renewed"); }
@Override public ProcessingException samlAssertionRevokedCouldNotRenew(String id) { return new ProcessingException(ErrorCodes.ASSERTION_RENEWAL_EXCEPTION + "SAMLV1.1 Assertion with id " + id + " has been canceled and cannot be renewed"); }
@Override public ProcessingException samlHandlerSignatureNotPresentError() { return new ProcessingException(ErrorCodes.INVALID_DIGITAL_SIGNATURE + "Signature Validation failed. Signature is not present. Check if the IDP is supporting signatures."); }
@Override public ProcessingException samlAssertionRevokedCouldNotRenew(String id) { return new ProcessingException(ErrorCodes.ASSERTION_RENEWAL_EXCEPTION + "SAMLV1.1 Assertion with id " + id + " has been canceled and cannot be renewed"); }
@Override public ProcessingException processingError(Throwable t) { return new ProcessingException(ErrorCodes.PROCESSING_EXCEPTION, t); }
@Override public ProcessingException samlAssertionExpiredError() { return new ProcessingException(ErrorCodes.EXPIRED_ASSERTION); }
@Override public ProcessingException couldNotCreateInstance(String fqn, Throwable t) { return new ProcessingException(ErrorCodes.CANNOT_CREATE_INSTANCE + fqn, t); }
@Override public ProcessingException samlAssertionMarshallError(Throwable t) { return new ProcessingException(ErrorCodes.PROCESSING_EXCEPTION + "Failed to marshall SAMLV1.1 assertion", t); }
@Override public ProcessingException wsTrustValidationStatusCodeMissing() { return new ProcessingException(ErrorCodes.NULL_VALUE + "Validation status code is missing"); }
@Override public ProcessingException samlHandlerAuthnRequestIsNull() { return new ProcessingException(ErrorCodes.NULL_VALUE + "AuthnRequest is null"); }
@Override public ProcessingException wsTrustNullRenewTargetError() { return new ProcessingException(ErrorCodes.NULL_VALUE + "Invalid renew request: missing required RenewTarget"); }
@Override public ProcessingException writerInvalidKeyInfoNullContentError() { return new ProcessingException(ErrorCodes.WRITER_INVALID_KEYINFO_NULL_CONTENT); }
@Override public ProcessingException samlHandlerFailedInResponseToVerificarionError() { return new ProcessingException(ErrorCodes.AUTHN_REQUEST_ID_VERIFICATION_FAILED); }
@Override public ProcessingException samlHandlerSignatureValidationError(Throwable t) { return new ProcessingException(ErrorCodes.INVALID_DIGITAL_SIGNATURE + "Signature Validation failed", t); }
protected void checkDestination(String destination, String expectedDestination) throws ProcessingException { if (expectedDestination == null) { throw logger.nullArgumentError("Expected destination."); } if (destination != null) { if (!destination.startsWith(expectedDestination)) { throw new ProcessingException("Invalid destination [" + destination + "]. Expected [" + expectedDestination + "]."); } } }
protected void checkDestination(String destination, String expectedDestination) throws ProcessingException { if (expectedDestination == null) { throw logger.nullArgumentError("Expected destination."); } if (destination != null) { if (!destination.startsWith(expectedDestination)) { throw new ProcessingException("Invalid destination [" + destination + "]. Expected [" + expectedDestination + "]."); } } }
@Override public void validateToken(ProtocolContext context) throws ProcessingException { if(context instanceof OAuthProtocolContext == false){ return; } OAuthProtocolContext oAuthProtocolContext = (OAuthProtocolContext) context; String samlAssertionID = oAuthProtocolContext.getSamlAssertionID(); check(); String oauthToken = (String) tokenRegistry.getToken(samlAssertionID); if(oauthToken == null){ throw new ProcessingException("Not Valid"); } }
protected Lifetime adjustLifetimeForClockSkew(Lifetime lifetime) throws ProcessingException { try { lifetime.setCreated( XMLTimeUtil.subtract(lifetime.getCreated(), getClockSkewInMillis())); lifetime.setExpires( XMLTimeUtil.add(lifetime.getExpires(), getClockSkewInMillis())); return lifetime; } catch( ConfigurationException ce ) { throw new ProcessingException(ce.getMessage()); } }
protected Lifetime adjustLifetimeForClockSkew(Lifetime lifetime) throws ProcessingException { try { lifetime.setCreated( XMLTimeUtil.subtract(lifetime.getCreated(), getClockSkewInMillis())); lifetime.setExpires( XMLTimeUtil.add(lifetime.getExpires(), getClockSkewInMillis())); return lifetime; } catch( ConfigurationException ce ) { throw new ProcessingException(ce.getMessage()); } }