hi everyone. I wanna design login page but there are some limitations that keep me from making what i want. Can i build my custom login page without using jmix loginForm attribute and authenticate users? Is this possible in jmix?
is this way of authentication ok for jmix?
UsernamePasswordAuthenticationToken authReq
= new UsernamePasswordAuthenticationToken(username.getValue(), password.getValue());
Authentication auth = authenticationManager.authenticate(authReq);
SecurityContext sc = SecurityContextHolder.getContext();
sc.setAuthentication(auth);
WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession(true);
session.setAttribute(SPRING_SECURITY_CONTEXT_KEY, sc);
it works pretty well and authenticates users.
Hello,
You can create your own login page.
Yes, Jmix is compatible with all Spring Security mechanisms.
Vaadin LoginForm:
https://docs.jmix.io/jmix/flow-ui/vc/components/loginForm.html
Authentication docs:
https://docs.jmix.io/jmix/security/authentication.html
Regards,
Nikita