Я пытаюсь получить FOM в RoleDescriptor
узла провайдера файл метаданных Service (SAML 2.0), используя следующий код и библиотеки OpenSaml:OpenSaml извлечение неправильный объект RoleDescriptor
EntitiesDescriptor entityDescriptors = getConfiguration(providerId);
List<RoleDescriptor> roleDescriptors = (List<RoleDescriptor>) entityDescriptors.getEntityDescriptors().get(0).
getRoleDescriptors();
EntityDescriptor ed = entityDescriptors.getEntityDescriptors().get(0);
if(roleDescriptors != null && !roleDescriptors.isEmpty()){
RoleDescriptor r = (RoleDescriptor) roleDescriptors.get(0);
return roleDescriptors.get(0).getErrorURL();
}
Мой вопрос заключается в том, что переменная r
Концы быть типа org.opensaml.saml2.metadata.impl.SPSSODescriptorImpl
и не org.opensaml.saml2.metadata.impl.RoleDescriptorImpl
Это файл метаданных XML Я использую:
<EntityDescriptor entityID="http://mysp.com/resource">
<RoleDescriptor errorURL="http://localhost:8080/dummy-sp/error.jsp">
</RoleDescriptor>
<SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor use="encryption">
<EncryptionMethod Algorithm=
"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256">
</EncryptionMethod>
</KeyDescriptor>
<AssertionConsumerService index="1"
isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="http://localhost:8080/dummy-sp/dummysp" />
</SPSSODescriptor>
<Organization>
<OrganizationName xml:lang="en">Your Service
</OrganizationName>
<OrganizationDisplayName xml:lang="en">Your
Service
</OrganizationDisplayName>
<OrganizationURL xml:lang="en">http://sp.example.org/
</OrganizationURL>
</Organization>
<ContactPerson contactType="technical">
<GivenName>Your</GivenName>
<SurName>Admin</SurName>
<EmailAddress>[email protected]</EmailAddress>
</ContactPerson>
</EntityDescriptor>
И, наконец, есть скан моего экрана отладки Eclipse:
Любое понимание по этому вопросу? – carcaret