Skip to content

Make OpenSamlMetadataRelyingPartyRegistrationConverter public #15090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
OrangeDog opened this issue May 17, 2024 · 2 comments
Closed

Make OpenSamlMetadataRelyingPartyRegistrationConverter public #15090

OrangeDog opened this issue May 17, 2024 · 2 comments
Assignees
Labels
in: saml2 An issue in SAML2 modules status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement

Comments

@OrangeDog
Copy link
Contributor

Expected Behavior

Class and its methods should be public.

Current Behavior

Class and its methods are package-private.

Context

To allow writing alternatives to RelyingPartyRegistrations and others by adapting OpenSAML APIs.
For example, in order to implement verification (#15018 (comment)) and refreshing (#15027 (comment)).

@OrangeDog OrangeDog added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels May 17, 2024
@jzheaux
Copy link
Contributor

jzheaux commented May 31, 2024

I believe this will be addressed in #12116. I'll leave this ticket open for the moment just in case the other evolves differently than I imagine.

@jzheaux jzheaux added in: saml2 An issue in SAML2 modules status: blocked An issue that's blocked on an external project change and removed status: waiting-for-triage An issue we've not yet triaged labels May 31, 2024
@jzheaux jzheaux self-assigned this May 31, 2024
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jun 29, 2024
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 2, 2024
This adds the RelyingPartyRegistrationsDecoder component
which allows configuration with signature verification credentials.

Closes spring-projectsgh-12116
Closes spring-projectsgh-15017
Closes spring-projectsgh-15090
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 2, 2024
This adds the RelyingPartyRegistrationsDecoder component
which allows configuration with signature verification credentials.

Closes spring-projectsgh-12116
Closes spring-projectsgh-15017
Closes spring-projectsgh-15090
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 2, 2024
This adds the RelyingPartyRegistrationsDecoder component
which allows configuration with signature verification credentials.

Closes spring-projectsgh-12116
Closes spring-projectsgh-15017
Closes spring-projectsgh-15090
jzheaux added a commit to jzheaux/spring-security that referenced this issue Jul 2, 2024
This adds the RelyingPartyRegistrationsDecoder component
which allows configuration with signature verification credentials.

Closes spring-projectsgh-12116
Closes spring-projectsgh-15017
Closes spring-projectsgh-15090
@OrangeDog
Copy link
Contributor Author

Workaround:

try {
    Class<?> converterClass = Class.forName("org.springframework.security.saml2.provider.service.registration.OpenSamlMetadataRelyingPartyRegistrationConverter");
    Constructor<?> converterConstructor = converterClass.getDeclaredConstructor();
    converterConstructor.setAccessible(true);
    Object converterInstance = converterConstructor.newInstance();
    Method converterMethod = converterClass.getDeclaredMethod("convert", EntityDescriptor.class);
    converterMethod.setAccessible(true);
    this.converter = value -> {
        try {
            return (RelyingPartyRegistration.Builder) converterMethod.invoke(converterInstance, value);
        } catch (InvocationTargetException ex) {
            if (ex.getTargetException() instanceof RuntimeException cause) {
                throw cause;
            } else {
                throw new RuntimeException("Cannot convert metadata", ex);
            }
        } catch (IllegalAccessException ex) {
            throw new IllegalStateException("Cannot convert metadata", ex);
        }
    };
}
catch (ReflectiveOperationException ex) {
    throw new IllegalStateException("Cannot initialise metadata converter", ex);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants