I wrote an application with Java Swing that requires the user to log in with their username and password before continuing. The application then sends an HTTP request to generate an access token.
I know that you shouldn't use the .getText method for a password field and instead the .getPassword method, still I need the password as a string, in order to make a HTTP request (okhttp3) with the password value in the request body (which is a string). How can I manage the security then?