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 AuthenticationServiceAuthentication 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 UserInfogetAuthenticatedUser()Check, if the current request is authenticated and if so return the current user dataTokenResponselogIn(TokenRequest loginRequest)Check username/password and return a bearer token.PingResultping()Just a ping request / response for checking availability of the serverPingResultpingWithAutz()This ping request is only successful, if the provided Bearer token is valid and authenticates a existing userTokenResponsetoken(TokenRefreshRequest request)Request a new token.
-
-
-
Constructor Detail
-
DefaultAuthenticationService
@Inject public DefaultAuthenticationService(SecuritySystem securitySystem)
-
-
Method Detail
-
ping
public PingResult ping()
Description copied from interface:AuthenticationServiceJust a ping request / response for checking availability of the server- Specified by:
pingin interfaceAuthenticationService- Returns:
- the ping result
-
pingWithAutz
public PingResult pingWithAutz()
Description copied from interface:AuthenticationServiceThis ping request is only successful, if the provided Bearer token is valid and authenticates a existing user- Specified by:
pingWithAutzin interfaceAuthenticationService- Returns:
- the ping result or a failure message
-
logIn
public TokenResponse logIn(TokenRequest loginRequest) throws RedbackServiceException
Description copied from interface:AuthenticationServiceCheck username/password and return a bearer token. The bearer token can be added to the HTTP header on further requests to authenticate.- Specified by:
logInin interfaceAuthenticationService- Throws:
RedbackServiceException
-
token
public TokenResponse token(TokenRefreshRequest request) throws RedbackServiceException
Description copied from interface:AuthenticationServiceRequest a new token.- Specified by:
tokenin interfaceAuthenticationService- Throws:
RedbackServiceException
-
getAuthenticatedUser
public UserInfo getAuthenticatedUser() throws RedbackServiceException
Description copied from interface:AuthenticationServiceCheck, if the current request is authenticated and if so return the current user data- Specified by:
getAuthenticatedUserin interfaceAuthenticationService- Throws:
RedbackServiceException
-
-