Skip to content

Commit

Permalink
Merge branch 'feature/shibui-2380' of bitbucket.org:unicon/shib-idp-u…
Browse files Browse the repository at this point in the history
…i into feature/shibui-2380
  • Loading branch information
rmathis committed Oct 5, 2022
2 parents f5bf0d8 + 06d49eb commit a7f7b84
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private EntityDescriptor buildDescriptorFromRepresentation(final EntityDescripto
setupLogout(ed, representation);
setupRelyingPartyOverrides(ed, representation);

if (ed.getProtocol() == EntityDescriptorProtocol.OIDC) {
if (ed.getProtocol() == EntityDescriptorProtocol.OIDC && ed.getSPSSODescriptor("") != null) {
ed.getSPSSODescriptor("").addSupportedProtocol("http://openid.net/specs/openid-connect-core-1_0.html");
}
//Let envers recognize update revision type for EntityDescriptor type
Expand All @@ -114,6 +114,9 @@ private EntityDescriptor buildDescriptorFromRepresentation(final EntityDescripto
*/
private Map<String, Object> buildOAuthRPExtensionsMap(EntityDescriptor ed) {
HashMap<String, Object> result = new HashMap<>();
if (!ed.getSPSSODescriptor("").getOptionalExtensions().isPresent()) {
return result;
}
for(XMLObject extension : ed.getSPSSODescriptor("").getExtensions().getOrderedChildren()) {
if (extension.getElementQName().getLocalPart().equals(OAuthRPExtensions.TYPE_LOCAL_NAME)){
OAuthRPExtensions oAuthRPExtensions = (OAuthRPExtensions) extension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public static void setupSPSSODescriptor(EntityDescriptor ed, EntityDescriptorRep
SPSSODescriptor spssoDescriptor = getSPSSODescriptorFromEntityDescriptor(ed);

spssoDescriptor.setSupportedProtocols(new ArrayList<>());
if (!Strings.isNullOrEmpty(representation.getServiceProviderSsoDescriptor().getProtocolSupportEnum())) {
if (representation.getServiceProviderSsoDescriptor() != null && !Strings.isNullOrEmpty(representation.getServiceProviderSsoDescriptor().getProtocolSupportEnum())) {
spssoDescriptor.setSupportedProtocols(
Arrays.stream(representation.getServiceProviderSsoDescriptor().getProtocolSupportEnum().split(",")).map(p -> MDDCConstants.PROTOCOL_BINDINGS.get(p.trim())).collect(Collectors.toList())
);
Expand All @@ -347,7 +347,7 @@ public static void setupSPSSODescriptor(EntityDescriptor ed, EntityDescriptorRep
}

// Setup Extensions
if (representation.getProtocol() == EntityDescriptorProtocol.OIDC) {
if (representation.getProtocol() == EntityDescriptorProtocol.OIDC && representation.getServiceProviderSsoDescriptor(false) != null) {
spssoDescriptor.setExtensions(buildOAuthRPExtensionsFromRepresentation(representation.getServiceProviderSsoDescriptor(false)));
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"type": "string"
}
},
"audience": {
"audiences": {
"title": "label.audience",
"description": "tooltip.audience",
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion ui/public/assets/schema/source/metadata-source-oidc.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"type": "string"
}
},
"audience": {
"audiences": {
"title": "label.audience",
"description": "tooltip.audience",
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const OidcSourceEditor = defaultsDeep({
'postLogoutRedirectUris',
'defaultAcrValues',
'requestUris',
'audience'
'audiences'
],
},
]
Expand All @@ -73,7 +73,7 @@ export const OidcSourceEditor = defaultsDeep({
orderable: false
},
},
audience: {
audiences: {
"ui:options": {
orderable: false
},
Expand Down Expand Up @@ -126,7 +126,7 @@ export const OidcSourceWizard = defaultsDeep({
'postLogoutRedirectUris',
'defaultAcrValues',
'requestUris',
'audience'
'audiences'
],
},
]
Expand All @@ -146,7 +146,7 @@ export const OidcSourceWizard = defaultsDeep({
orderable: false
},
},
audience: {
audiences: {
"ui:options": {
orderable: false
},
Expand All @@ -156,5 +156,3 @@ export const OidcSourceWizard = defaultsDeep({
}
}, SourceBase.uiSchema)
}, OidcSourceBase);


0 comments on commit a7f7b84

Please sign in to comment.