public URI getSenderURL() { URI assertionConsumerServiceURL = getAssertionConsumerServiceURL(); if (assertionConsumerServiceURL != null) { return assertionConsumerServiceURL; } NameIDType issuer = getIssuer(); try { if (issuer != null) { return URI.create(issuer.getValue()); } } catch (Exception e) { throw new RuntimeException("Could not resolve sender URL using the Issuer value [" + issuer.getValue() + "]." , e); } throw new RuntimeException("Could not resolve sender URL. AuthnRequest must have a value for AssertionConsumerServiceURL or Issuer."); } }