@Requires(property="micronaut.security.endpoints.login.enabled", value="true") @Controller(value="${micronaut.security.endpoints.login.path:/login}") @Secured(value="isAnonymous()") @Validated public class LoginController extends Object
Modifier and Type | Field and Description |
---|---|
protected Authenticator |
authenticator |
protected ApplicationEventPublisher |
eventPublisher |
protected LoginHandler |
loginHandler |
Constructor and Description |
---|
LoginController(Authenticator authenticator,
LoginHandler loginHandler,
ApplicationEventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
io.reactivex.Single<HttpResponse> |
login(@Valid UsernamePasswordCredentials usernamePasswordCredentials,
HttpRequest<?> request) |
protected final Authenticator authenticator
protected final LoginHandler loginHandler
protected final ApplicationEventPublisher eventPublisher
public LoginController(Authenticator authenticator, LoginHandler loginHandler, ApplicationEventPublisher eventPublisher)
authenticator
- Authenticator
collaboratorloginHandler
- A collaborator which helps to build HTTP response depending on success or failure.eventPublisher
- The application event publisher@Consumes(value={"application/x-www-form-urlencoded","application/json"}) @Post public io.reactivex.Single<HttpResponse> login(@Valid @Body @Valid UsernamePasswordCredentials usernamePasswordCredentials, HttpRequest<?> request)
usernamePasswordCredentials
- An instance of UsernamePasswordCredentials
in the body payloadrequest
- The HttpRequest
being executed