Skip to content

Conversation

@dbrant
Copy link
Member

@dbrant dbrant commented Sep 22, 2025

@dbrant dbrant added the WIP Work in progress label Sep 22, 2025
HCaptchaConfig.builder()
.siteKey("f1f21d64-6384-4114-b7d0-d9d23e203b4a")
.theme(if (WikipediaApp.instance.currentTheme.isDark) HCaptchaTheme.DARK else HCaptchaTheme.LIGHT)
.host("meta.wikimedia.org")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can leave this line unset

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WebView popped up by the hCaptcha SDK requires a base URL that matches our content-security-policy, otherwise the iframe inside the WebView will refuse to load the hcaptcha content.

.endpoint("https://hcaptcha.wikimedia.org")
.assethost("https://assets-hcaptcha.wikimedia.org")
.imghost("https://imgs-hcaptcha.wikimedia.org")
.reportapi("https://report-hcaptcha.wikimedia.org")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(todo: all the above parameters will be served up via our new remote configuration endpoint)

@dbrant dbrant changed the base branch from main to hCaptchaPre September 24, 2025 13:48
Base automatically changed from hCaptchaPre to main September 24, 2025 16:39
@dbrant dbrant added Ready for Review and removed WIP Work in progress labels Nov 17, 2025
private var hCaptcha: HCaptcha? = null
private var tokenResponse: HCaptchaTokenResponse? = null

private val configDefault get() = RemoteConfig.RemoteConfigHCaptcha(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: even though these parameters are served by our remote configuration, we still want to hardcode some defaults here, in case the network call to fetch remote configuration fails.

Copy link
Collaborator

@cooltey cooltey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could not be able to test this because of the error code sitekey-mismatch

imgHost = "https://imgs-hcaptcha.wikimedia.org",
reportApi = "https://report-hcaptcha.wikimedia.org",
sentry = false,
siteKey = "e11698d6-51ca-4980-875c-72309c6678cc"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the siteKey is outdated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm curious, looking into this with the other team...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now on the backend.

@dbrant dbrant added HOLD Will review as soon as other more pressing PRs are merged/released. and removed Ready for Review labels Nov 25, 2025
@dbrant dbrant removed the HOLD Will review as soon as other more pressing PRs are merged/released. label Dec 1, 2025
@dbrant dbrant added the HOLD Will review as soon as other more pressing PRs are merged/released. label Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HOLD Will review as soon as other more pressing PRs are merged/released.

Development

Successfully merging this pull request may close these issues.

4 participants