-
Notifications
You must be signed in to change notification settings - Fork 86
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
Captcha is incompatible with SSO #1334
Comments
@tbouliere-datasolution Can you please provide more details for the problematic use case? |
Captchas are mainly used to prevent spamming. It is a very strong assumption to limit captchas to non-registered users. |
For example, you can take the function "send the product to a friend". |
Well the registration is exactly an example for a non-registered user interaction that is protected by a captcha in the PWA if it is not done with SSO. |
The current implementation for "Email a friend" uses the users mail program exactly to prevent spam being send from the PWA/ICM. In the standard there is nothing that we could protect with an additional Captcha here. But I will talk the according REST API team to check whether they see any use case that requires a combination of both authentication methods for one request. |
Ok I see your point @shauke. However I still think that a catcha can be necessary, on pages that need to be accessible for both logged in and not logged in users. For example for the feature, contact-us (https://intershoppwa.azurewebsites.net/contact) intershop-pwa/src/app/extensions/contact-us/pages/contact/contact-form/contact-form.component.ts Line 117 in 7412e25
and a backend coded check : if (this.authenticationProvider != null
&& this.authenticationProvider instanceof CaptchaAuthenticationProvider) {
final CaptchaAuthenticationProvider cap = (CaptchaAuthenticationProvider) this.authenticationProvider;
if (cap.isCaptchaRequired("intershop.CaptchaPreferences.ContactUs")) {
cap.authenticate(this.currentRequest, this.currentResponse);
}
} And you got a probleme there. Either you activate the captcha feature and you protected non login pages, but it crash when you have an SSO BearerToken, or you desactivate the captcha for everyone. This is why I think that captcha should not be treat as an authentification state. |
After discussion with the responsible ICM REST API team it was decided to implement the suggestion to expect the Captcha token at an alternative header key (with fallback to the ApiService.AUTHORIZATION_HEADER_KEY for backwards compatibility). Once an ICM release with this change is available the PWA implementation will be adapted accordingly. |
Nice ! |
Adapted headers available with ICM 7.10.40 and ICM 11.0.12. |
When using the Google Recaptcha V3 service, the captcha verification information is transmitted to the icm using the
Authorization
header.intershop-pwa/src/app/core/services/api/api.service.ts
Line 82 in 9964ebd
This conflicts with the standard SSO operation which uses this header to pass a bearer token
intershop-pwa/src/app/core/identity-provider/auth0.identity-provider.ts
Line 251 in 9964ebd
Expected Behavior
Use a custom header. For instance X-Captcha-Token.
And remember to modify the corresponding class on the icm side:
com.intershop.sellside.rest.common.internal.auth.CaptchaAuthenticationProvider
Steps to Reproduce the Bug
Steps to reproduce the behavior:
Environment Details
Additional Context, like Screenshots, Log File Snippets etc.
AB#81572
The text was updated successfully, but these errors were encountered: