// it)
if (!relyingParty.isLegacyProvider() && pushAttributes(artifactProfile, relyingParty)) {
log.info("Resolving attributes for push.");
- SAMLAssertion attrAssertion = generateAttributeAssertion(support, principal, relyingParty, authNSubject);
+ SAMLAssertion attrAssertion = generateAttributeAssertion(support, principal, relyingParty,
+ authNSubject, request);
if (attrAssertion != null) {
assertions.add(attrAssertion);
} else {
}
private SAMLAssertion generateAttributeAssertion(IdPProtocolSupport support, LocalPrincipal principal,
- RelyingParty relyingParty, SAMLSubject authNSubject) throws SAMLException {
+ RelyingParty relyingParty, SAMLSubject authNSubject, HttpServletRequest request) throws SAMLException {
try {
SAMLAttribute[] attributes = support.getReleaseAttributes(principal, relyingParty, relyingParty
if (relyingParty.getName() != null && !relyingParty.getName().equals(relyingParty.getProviderId())) {
audiences.add(relyingParty.getName());
}
+ String remoteProviderId = request.getParameter("providerId");
+ if (remoteProviderId != null && !remoteProviderId.equals("") && !audiences.contains(remoteProviderId)) {
+ audiences.add(remoteProviderId);
+ }
+
SAMLCondition condition = new SAMLAudienceRestrictionCondition(audiences);
// Put all attributes into an assertion
if (relyingParty.getName() != null && !relyingParty.getName().equals(relyingParty.getProviderId())) {
audiences.add(relyingParty.getName());
}
+ String remoteProviderId = request.getParameter("providerId");
+ if (remoteProviderId != null && !remoteProviderId.equals("") && !audiences.contains(remoteProviderId)) {
+ audiences.add(remoteProviderId);
+ }
// Determine the correct issuer
String issuer = null;