{"id":31527154,"url":"https://github.com/mkopylec/recaptcha-spring-boot-starter","last_synced_at":"2025-10-03T21:58:35.054Z","repository":{"id":57721586,"uuid":"46569376","full_name":"mkopylec/recaptcha-spring-boot-starter","owner":"mkopylec","description":"Spring Boot starter for Google's reCAPTCHA","archived":false,"fork":false,"pushed_at":"2019-07-12T13:15:31.000Z","size":364,"stargazers_count":109,"open_issues_count":1,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-15T03:06:13.775Z","etag":null,"topics":["captcha","java","recaptcha","spring","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkopylec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-20T15:16:20.000Z","updated_at":"2024-09-11T04:46:47.000Z","dependencies_parsed_at":"2022-09-26T21:51:48.556Z","dependency_job_id":null,"html_url":"https://github.com/mkopylec/recaptcha-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/mkopylec/recaptcha-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopylec%2Frecaptcha-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopylec%2Frecaptcha-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopylec%2Frecaptcha-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopylec%2Frecaptcha-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkopylec","download_url":"https://codeload.github.com/mkopylec/recaptcha-spring-boot-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkopylec%2Frecaptcha-spring-boot-starter/sbom","scorecard":{"id":652780,"data":{"date":"2025-08-11","repo":{"name":"github.com/mkopylec/recaptcha-spring-boot-starter","commit":"7d5a1ff6dcf23e6768e72a7fc271c85cea14588d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T13:53:30.415Z","repository_id":57721586,"created_at":"2025-08-21T13:53:30.415Z","updated_at":"2025-08-21T13:53:30.415Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278234034,"owners_count":25953075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","java","recaptcha","spring","spring-boot"],"created_at":"2025-10-03T21:58:27.380Z","updated_at":"2025-10-03T21:58:35.041Z","avatar_url":"https://github.com/mkopylec.png","language":"Java","readme":"# reCAPTCHA Spring Boot Starter\n[![Build Status](https://travis-ci.org/mkopylec/recaptcha-spring-boot-starter.svg?branch=master)](https://travis-ci.org/mkopylec/recaptcha-spring-boot-starter)\n[![Coverage Status](https://coveralls.io/repos/mkopylec/recaptcha-spring-boot-starter/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/mkopylec/recaptcha-spring-boot-starter?branch=master)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.mkopylec/recaptcha-spring-boot-starter/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.mkopylec/recaptcha-spring-boot-starter)\n\nTo use the starter you will need a reCAPTCHA site key and a secret key.\nTo get them go to the [reCAPTCHA Home Page](https://www.google.com/recaptcha/intro/index.html) and set up your reCAPTCHA.\n\n## Installing\n\n```gradle\nrepositories {\n    mavenCentral()\n}\ndependencies {\n    compile group: 'com.github.mkopylec', name: 'recaptcha-spring-boot-starter', version: '2.3.1'\n}\n```\n\n## How to use\nThe starter can be used in 3 different modes:\n\n### Normal web application usage\nEmbed reCAPTCHA in HTML web page:\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cscript src=\"https://www.google.com/recaptcha/api.js\" async defer\u003e\u003c/script\u003e\n    ...\n\u003c/head\u003e\n\u003cbody\u003e\n\n\u003cform action=\"/\" method=\"post\"\u003e\n    \u003cdiv class=\"g-recaptcha\" data-sitekey=\"\u003cyour_site_key\u003e\"\u003e\u003c/div\u003e\n    \u003cinput type=\"submit\" value=\"Validate reCAPTCHA\" /\u003e\n\u003c/form\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nInject `RecaptchaValidator` into your controller and validate user reCAPTCHA response:\n\n```java\n@Controller\npublic class MainController {\n\n    @Autowired\n    private RecaptchaValidator recaptchaValidator;\n\n    @PostMapping(\"/\")\n    public void validateCaptcha(HttpServletRequest request) {\n        ValidationResult result = recaptchaValidator.validate(request);\n        if (result.isSuccess()) {\n            ...\n        }\n    }\n}\n```\n\nSet your secret key in _application.yml_ file:\n\n```yaml\nrecaptcha.validation.secret-key: \u003cyour_secret_key\u003e\n```\n\n##### Additional info\n`RecaptchaValidator` provides couple of useful methods to validate reCAPTCHA response.\n\n### Spring Security web application usage\nAdd Spring Security dependency:\n\n```gradle\ndependencies {\n    compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.1.6.RELEASE'\n}\n```\n\nEmbed reCAPTCHA in HTML **login** web page:\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cscript src=\"https://www.google.com/recaptcha/api.js\" async defer\u003e\u003c/script\u003e\n    ...\n\u003c/head\u003e\n\u003cbody\u003e\n\n\u003cform action=\"/login\" method=\"post\"\u003e\n    User: \u003cinput name=\"username\" type=\"text\" value=\"\" /\u003e\n    Password: \u003cinput name=\"password\" type=\"password\" value=\"\" /\u003e\n    \u003c!--\u003cif request has 'showRecaptcha' query param\u003e--\u003e\n    \u003cdiv class=\"g-recaptcha\" data-sitekey=\"\u003cyour_site_key\u003e\"\u003e\u003c/div\u003e\n    \u003c!--\u003c/if\u003e--\u003e\n    \u003cinput type=\"submit\" value=\"Log in\" /\u003e\n\u003c/form\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nAdd reCAPTCHA support to your form login security configuration using `FormLoginConfigurerEnhancer`.\n\n```java\n@Configuration\n@EnableWebSecurity\npublic class SecurityConfiguration extends WebSecurityConfigurerAdapter {\n\n    @Autowired\n    private FormLoginConfigurerEnhancer enhancer;\n\n    @Override\n    protected void configure(HttpSecurity http) throws Exception {\n        enhancer.addRecaptchaSupport(http.formLogin()).loginPage(\"/login\")\n                .and()\n                .csrf().disable()\n                ...\n    }\n}\n```\n\nCreate custom login failures manager bean by extending `LoginFailuresManager`:\n\n```java\n@Component\npublic class CustomLoginFailuresManager extends LoginFailuresManager {\n\n    public CustomLoginFailuresManager(RecaptchaProperties recaptcha) {\n        super(recaptcha);\n    }\n\n    ...\n}\n```\n\nSet your secret key in _application.yml_ file:\n\n```yaml\nrecaptcha.validation.secret-key: \u003cyour_secret_key\u003e\n```\n\n##### Additional info\nAfter adding reCAPTCHA support to form login configuration you can only add `AuthenticationSuccessHandler` that extends\n`LoginFailuresClearingHandler` and `AuthenticationFailureHandler` that extends `LoginFailuresCountingHandler`.\n\nThere can be 4 different query parameters in redirect to login page:\n - _error_ - credentials authentication error\n - _recaptchaError_ - reCAPTCHA authentication error\n - _showRecaptcha_ - reCAPTCHA must be displayed on login page\n - _logout_ - user has been successfully logged out\n\nThere is a default `LoginFailuresManager` implementation in the starter which is `InMemoryLoginFailuresManager`.\nIt is recommended to create your own `LoginFailuresManager` implementation that persists login failures in some storage.\n\n### Integration testing mode usage\nEnable testing mode:\n\n```yaml\nrecaptcha.testing.enabled: true\n```\n\nConfigure testing mode:\n\n```yaml\nrecaptcha.testing:\n  success-result: false\n  result-error-codes: INVALID_SECRET_KEY, INVALID_USER_CAPTCHA_RESPONSE\n```\n\n##### Additional info\nIn testing mode no remote reCAPTCHA validation is fired, the validation process is offline.\n\n## Configuration properties list\n\n```yaml\nrecaptcha:\n  validation:\n    secret-key: # reCAPTCHA secret key.\n    response-parameter: g-recaptcha-response # HTTP request parameter name containing user reCAPTCHA response.\n    verification-url: https://www.google.com/recaptcha/api/siteverify # reCAPTCHA validation endpoint.\n    timeout:\n      connect: 500ms # reCAPTCHA validation request connect timeout.\n      read: 1000ms # reCAPTCHA validation request read timeout.\n      write: 1000ms # reCAPTCHA validation request write timeout.\n  security:\n    failure-url: /login # URL to redirect to when user authentication fails.\n    login-failures-threshold: 5 # Number of allowed login failures before reCAPTCHA must be displayed.\n    continue-on-validation-http-error: true # Permits or denies continuing user authentication process after reCAPTCHA validation fails because of HTTP error.\n  testing:\n    enabled: false # Flag for enabling and disabling testing mode.\n    success-result: true # Defines successful or unsuccessful validation result, can be changed during tests.\n    result-error-codes: # Errors in validation result, can be changed during tests.\n```\n\n## Examples\nGo to [reCAPTCHA Spring Boot Starter samples](https://github.com/mkopylec/recaptcha-spring-boot-starter-samples) to view example applications.\n\n## License\nreCAPTCHA Spring Boot Starter is published under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkopylec%2Frecaptcha-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkopylec%2Frecaptcha-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkopylec%2Frecaptcha-spring-boot-starter/lists"}