Class DefaultAuthenticationService
- java.lang.Object
-
- org.apache.archiva.redback.rest.services.v2.DefaultAuthenticationService
-
- All Implemented Interfaces:
AuthenticationService
@Service("v2.authenticationService#rest") public class DefaultAuthenticationService extends Object implements AuthenticationService
Authentication service provides REST methods for authentication and verification.- Since:
- 3.0
- Author:
- Olivier Lamy, Martin Stockhammer
-
-
Constructor Summary
Constructors Constructor Description DefaultAuthenticationService(SecuritySystem securitySystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UserInfo
getAuthenticatedUser()
Check, if the current request is authenticated and if so return the current user dataTokenResponse
logIn(TokenRequest loginRequest)
Check username/password and return a bearer token.PingResult
ping()
Just a ping request / response for checking availability of the serverPingResult
pingWithAutz()
This ping request is only successful, if the provided Bearer token is valid and authenticates a existing userTokenResponse
token(TokenRefreshRequest request)
Request a new token.
-
-
-
Constructor Detail
-
DefaultAuthenticationService
@Inject public DefaultAuthenticationService(SecuritySystem securitySystem)
-
-
Method Detail
-
ping
public PingResult ping()
Description copied from interface:AuthenticationService
Just a ping request / response for checking availability of the server- Specified by:
ping
in interfaceAuthenticationService
- Returns:
- the ping result
-
pingWithAutz
public PingResult pingWithAutz()
Description copied from interface:AuthenticationService
This ping request is only successful, if the provided Bearer token is valid and authenticates a existing user- Specified by:
pingWithAutz
in interfaceAuthenticationService
- Returns:
- the ping result or a failure message
-
logIn
public TokenResponse logIn(TokenRequest loginRequest) throws RedbackServiceException
Description copied from interface:AuthenticationService
Check username/password and return a bearer token. The bearer token can be added to the HTTP header on further requests to authenticate.- Specified by:
logIn
in interfaceAuthenticationService
- Throws:
RedbackServiceException
-
token
public TokenResponse token(TokenRefreshRequest request) throws RedbackServiceException
Description copied from interface:AuthenticationService
Request a new token.- Specified by:
token
in interfaceAuthenticationService
- Throws:
RedbackServiceException
-
getAuthenticatedUser
public UserInfo getAuthenticatedUser() throws RedbackServiceException
Description copied from interface:AuthenticationService
Check, if the current request is authenticated and if so return the current user data- Specified by:
getAuthenticatedUser
in interfaceAuthenticationService
- Throws:
RedbackServiceException
-
-