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 SummaryModifier and TypeMethodDescriptionvoidClears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate.voidIncrements by one the number of failed authentication attempts the user has made.booleanisRequired(String username) Returns whether a CAPTCHA challenge is required for the user with supplied username.booleanvalidate(CaptchaResponse captchaResponse) Validates a CAPTCHA challenge.
- 
Method Details- 
clearClears 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
 
- 
incrementFailedAuthenticationAttemptCountIncrements 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
 
- 
isRequiredReturns whether a CAPTCHA challenge is required for the user with supplied username.- Parameters:
- username- the username of the user to check against
- Returns:
- trueif that user must answer a CAPTCHA challenge the next time they authenticate, otherwise- false
 
- 
validateValidates a CAPTCHA challenge.- Parameters:
- captchaResponse- the response to the CAPTCHA challenge as provided by the user
- Returns:
- trueif the CAPTCHA challenge has been resolved correctly, otherwise- false
 
 
-