public interface

RememberMeService

com.atlassian.bitbucket.auth.RememberMeService

Class Overview

Provides remember-me authentication

Summary

Public Methods
@Nullable ApplicationUser authenticate(HttpServletRequest request, HttpServletResponse response)
Attempts to authenticate a request using the remember-me cookie provided on the request.
void createCookie(HttpServletRequest request, HttpServletResponse response)
Generates a new remember-me token for the user and sets the corresponding cookie on the response.
void logout(HttpServletRequest request, HttpServletResponse response)
Clears the remember-me cookie and removes all remember-me tokens for the corresponding series

Public Methods

@Nullable public ApplicationUser authenticate (HttpServletRequest request, HttpServletResponse response)

Attempts to authenticate a request using the remember-me cookie provided on the request. If authentication succeeds, a new remember-me token is created for the user and a new cookie is set on the response. If authentication fails for any reason, the cookie is cleared on the response.

Parameters
request the request
response the response
Returns
  • the authenticated user, or null if authentication failed.

public void createCookie (HttpServletRequest request, HttpServletResponse response)

Generates a new remember-me token for the user and sets the corresponding cookie on the response. This will cancel an existing remember me cookie if such was provided. The user needs to be set in the AuthenticationContext first.

Parameters
request the request
response the response

public void logout (HttpServletRequest request, HttpServletResponse response)

Clears the remember-me cookie and removes all remember-me tokens for the corresponding series

Parameters
request the request
response the response