-
Notifications
You must be signed in to change notification settings - Fork 32
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
EPMRPP-88378 || Remove old saml implementation #345
base: develop
Are you sure you want to change the base?
Conversation
.forEach(value -> externalProviders.get(value).setAssertionConsumerServiceIndex(value)); | ||
return externalProviders; | ||
}; | ||
// public static final Function<List<Integration>, List<ExternalIdentityProviderConfiguration>> TO_EXTERNAL_PROVIDER_CONFIG = integrations -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 144).
// IntStream.range(0, externalProviders.size()) | ||
// .forEach(value -> externalProviders.get(value).setAssertionConsumerServiceIndex(value)); | ||
// return externalProviders; | ||
// }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 2, indentation should be the same level as line 97.
@Override | ||
public Subject getCredentials() { | ||
return subject; | ||
public ReportPortalSamlAuthentication(Saml2Authentication defaultSamlAuthentication) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.
public ReportPortalSamlAuthentication(Saml2Authentication defaultSamlAuthentication) { | ||
super((AuthenticatedPrincipal) defaultSamlAuthentication.getPrincipal(), | ||
defaultSamlAuthentication.getSaml2Response(), Collections.EMPTY_LIST); | ||
AuthenticatedPrincipal principal = (AuthenticatedPrincipal) defaultSamlAuthentication.getPrincipal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 105).
//import org.springframework.security.saml.key.KeyType; | ||
//import org.springframework.security.saml.key.SimpleKey; | ||
//import org.springframework.security.saml.provider.config.SamlConfigurationRepository; | ||
//import org.springframework.security.saml.provider.provisioning.HostBasedSamlServiceProviderProvisioning; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 106).
//import org.springframework.security.saml.provider.service.AuthenticationRequestEnhancer; | ||
//import org.springframework.security.saml.provider.service.HostedServiceProviderService; | ||
//import org.springframework.security.saml.provider.service.config.ExternalIdentityProviderConfiguration; | ||
//import org.springframework.security.saml.provider.service.config.LocalServiceProviderConfiguration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 101).
@@ -55,18 +44,16 @@ | |||
@Service | |||
public class SamlIntegrationStrategy extends AuthIntegrationStrategy { | |||
|
|||
private final SamlProviderProvisioning<ServiceProviderService> serviceProviderProvisioning; | |||
// private final SamlProviderProvisioning<ServiceProviderService> serviceProviderProvisioning; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 2, indentation should be the same level as line 48.
@@ -105,31 +92,31 @@ | |||
|
|||
@Override | |||
protected Integration save(Integration integration) { | |||
populateProviderDetails(integration); | |||
// populateProviderDetails(integration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 96.
// .findFirst().orElse(NameId.UNSPECIFIED)); | ||
// | ||
// params.put(IDP_NAME_ID.getParameterName(), nameId.toString()); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 2, indentation should be the same level as line 93.
//import java.util.List; | ||
//import org.springframework.context.ApplicationListener; | ||
//import org.springframework.security.saml.provider.SamlServerConfiguration; | ||
//import org.springframework.security.saml.provider.service.config.LocalServiceProviderConfiguration; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 101).
http.apply(serviceProvider()).configure(serverConfiguration); | ||
|
||
// add auto-generation of ServiceProvider Metadata | ||
Converter<HttpServletRequest, RelyingPartyRegistration> relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(relyingParty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 155).
|
||
// add auto-generation of ServiceProvider Metadata | ||
Converter<HttpServletRequest, RelyingPartyRegistration> relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(relyingParty()); | ||
Saml2MetadataFilter filter = new Saml2MetadataFilter(relyingPartyRegistrationResolver, new OpenSamlMetadataResolver()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 123).
samlLogin.loginPage("/saml/sp/discovery") | ||
.successHandler(successHandler) | ||
.failureHandler(failureHandler) | ||
.authenticationManager(new ReportPortalSamlAuthenticationManager(samlUserReplicator)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 105).
|
||
} | ||
|
||
@Bean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.
.registrationId("report.portal.sp.id") | ||
.entityId(entityId) | ||
.assertionConsumerServiceLocation(SamlParameter.BASE_PATH.getParameter(provider).get()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 109).
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.epam.reportportal.auth.config.saml; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'package' should be separated from previous line.
import org.springframework.security.saml2.provider.service.web.authentication.Saml2WebSsoAuthenticationFilter; | ||
import org.springframework.security.web.DefaultSecurityFilterChain; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary javadoc is missing.
|
||
private RelyingPartyRegistrationRepository relyingPartyRegistrationRepository; | ||
|
||
public Saml2AuthenticationConfigurer(SamlAuthSuccessHandler successHandler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a Javadoc comment.
@Override | ||
public void configure(HttpSecurity http) { | ||
LOGGER.error("Saml2AuthenticationConfigurer: " + http); | ||
Saml2WebSsoAuthenticationFilter saml2Filter = new Saml2WebSsoAuthenticationFilter(relyingPartyRegistrationRepository); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 122).
public void configure(HttpSecurity http) { | ||
LOGGER.error("Saml2AuthenticationConfigurer: " + http); | ||
Saml2WebSsoAuthenticationFilter saml2Filter = new Saml2WebSsoAuthenticationFilter(relyingPartyRegistrationRepository); | ||
saml2Filter.setAuthenticationManager(new ReportPortalSamlAuthenticationManager(samlUserReplicator)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 104).
|
||
@Bean | ||
public RelyingPartyRegistrationRepository relyingParty() throws Exception { | ||
IntegrationType samlIntegrationType = integrationTypeRepository.findByName(AuthIntegrationType.SAML.getName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 114).
.assertionConsumerServiceLocation(SamlParameter.BASE_PATH.getParameter(provider).get()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 153.
|
||
// X509Certificate certificate = CertificationUtil.getCertificateByName(keyAlias, keyStore, | ||
// keyStorePassword); | ||
// Saml2X509Credential credential = Saml2X509Credential.verification(certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 144.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 155.
.fromMetadataLocation(SamlParameter.IDP_METADATA_URL.getParameter(provider).get()) | ||
.registrationId("report.portal.sp.id") | ||
.entityId(entityId) | ||
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 120).
|
||
// X509Certificate certificate = CertificationUtil.getCertificateByName(keyAlias, keyStore, | ||
// keyStorePassword); | ||
// Saml2X509Credential credential = Saml2X509Credential.verification(certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 141.
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 150.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 152.
|
||
// X509Certificate certificate = CertificationUtil.getCertificateByName(keyAlias, keyStore, | ||
// keyStorePassword); | ||
// Saml2X509Credential credential = Saml2X509Credential.verification(certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 142.
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 151.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 153.
|
||
// X509Certificate certificate = CertificationUtil.getCertificateByName(keyAlias, keyStore, | ||
// keyStorePassword); | ||
// Saml2X509Credential credential = Saml2X509Credential.verification(certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 147.
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 156.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 158.
|
||
// X509Certificate certificate = CertificationUtil.getCertificateByName(keyAlias, keyStore, | ||
// keyStorePassword); | ||
// Saml2X509Credential credential = Saml2X509Credential.verification(certificate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 4, indentation should be the same level as line 148.
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 157.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 159.
http.apply(serviceProvider()).configure(serverConfiguration); | ||
|
||
// add auto-generation of ServiceProvider Metadata | ||
RelyingPartyRegistrationResolver relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(relyingPartyRegistrationRepository); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 152).
// add auto-generation of ServiceProvider Metadata | ||
RelyingPartyRegistrationResolver relyingPartyRegistrationResolver = new DefaultRelyingPartyRegistrationResolver(relyingPartyRegistrationRepository); | ||
Saml2MetadataFilter filter = new Saml2MetadataFilter(relyingPartyRegistrationResolver, new OpenSamlMetadataResolver()); | ||
var authenticationRequestResolver = new OpenSaml4AuthenticationRequestResolver(relyingPartyRegistrationResolver); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 117).
.failureHandler(failureHandler) | ||
.authenticationManager(new ReportPortalSamlAuthenticationManager(samlUserReplicator)) | ||
.authenticationRequestResolver(authenticationRequestResolver) | ||
.authenticationConverter(new Saml2AuthenticationTokenConverter(relyingPartyRegistrationResolver)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 117).
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.epam.reportportal.auth.config.saml; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'package' should be separated from previous line.
import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrations; | ||
import org.springframework.security.saml2.provider.service.registration.Saml2MessageBinding; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary javadoc is missing.
.fromMetadataLocation(SamlParameter.IDP_METADATA_URL.getParameter(provider).get()) | ||
.registrationId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.entityId(entityId) | ||
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 120).
.registrationId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.entityId(entityId) | ||
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 109).
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 102).
.assertionConsumerServiceLocation(samlIntegrationType.getDetails().getDetails().get("callbackUrl").toString()) | ||
.assertingPartyDetails(party -> party.entityId(SamlParameter.IDP_NAME.getParameter(provider).get()) | ||
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 14, indentation should be the same level as line 117.
.wantAuthnRequestsSigned(false) | ||
// .singleSignOnServiceLocation(samlProperties.getAssertingpParty().getServiceLocation()) | ||
.singleSignOnServiceBinding(Saml2MessageBinding.POST)) | ||
// .signingX509Credentials(c -> c.add(credential)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment has incorrect indentation level 0, expected is 10, indentation should be the same level as line 119.
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
super.configure(http); | ||
http.apply(serviceProvider()).configure(serverConfiguration); | ||
LOGGER.error("findByRegistrationId: " + relyingPartyRegistrationRepository.findByRegistrationId("microsoft")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is longer than 100 characters (found 114).
Quality Gate failedFailed conditions |
No description provided.