Since the new username and password were just created, authentication should be straightforward. However, the Tomcat WebAuthentication.login did many activities within its call from a HttpServlet including:
- Finding or creating an HttpSession.
- Installing authentication information in the HttpSession.
- Propogating single-sign-on.
- Generating session cookies (if the user allows).
- Preparing for HttpServletResponse.encodeURL when cookies are not allowed.
What are the Undertow interfaces to perform such activities? Will just creating a SecurityIdentity do it all?
On Thursday, April 28, 2022 at 6:20:55 AM UTC-7 Diana Krepinska wrote:
Programmatic login can be achieved by obtaining a current SecurityDomain and by using one of the authenticate methods which will give you a SecurityIdentity. Then you can use one of the runAs methods of the SecurityIdentity, if this is what you need. Btw there is an example that updates/displays the user's attributes here if it helps.