Package com.atlassian.bitbucket.user
Interface CaptchaService
public interface CaptchaService
This service is used to help issue and validate a CAPTCHA challenge. It is intended to be used by other plugins
such as the Authentication plugin to interact with Bitbucket without having to expose underlying services.
- Since:
- 9.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate.void
Increments by one the number of failed authentication attempts the user has made.boolean
isRequired
(String username) Returns whether a CAPTCHA challenge is required for the user with supplied username.boolean
validate
(CaptchaResponse captchaResponse) Validates a CAPTCHA challenge.
-
Method Details
-
clear
Clears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate. Additionally, any counter or metric that contributed towards the user being issued the CAPTCHA challenge (for instance too many consecutive failed logins) will also be reset.- Parameters:
username
- the user whose captcha challenge should be cleared- Throws:
AuthorisationException
- when the user does not have admin permissions- Since:
- 9.2
-
incrementFailedAuthenticationAttemptCount
Increments by one the number of failed authentication attempts the user has made. Once the user reaches the maximum number of failed login attempts allowed, the user is then required to complete a CAPTCHA challenge.This information is local to this Bitbucket instance. It may not correspond with any such count recorded by a remote directory server or remote Crowd.
- Parameters:
username
- the username of the user whose attempt count should be incremented- Throws:
ServerException
- if Crowd does not permit updating the corresponding attribute- Since:
- 9.2
-
isRequired
Returns whether a CAPTCHA challenge is required for the user with supplied username.- Parameters:
username
- the username of the user to check against- Returns:
true
if that user must answer a CAPTCHA challenge the next time they authenticate, otherwisefalse
-
validate
Validates a CAPTCHA challenge.- Parameters:
captchaResponse
- the response to the CAPTCHA challenge as provided by the user- Returns:
true
if the CAPTCHA challenge has been resolved correctly, otherwisefalse
-