I am using front end angularJs and backend Java.
I have created JWT Token using below code
UsernamePasswordAuthenticationToken authenticationToken =
new UsernamePasswordAuthenticationToken(username, password);
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
boolean rememberMe = (isRememberMe == null) ? false : isRememberMe;
String jwt = tokenProvider.createToken(authentication, rememberMe);
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
this is working in case of login with username and password
Now I want to do login with mobile and OTP. In that case How I can create the authentication and jwt token ?