Which is the best way to send credentials to a login API ?

Hi everyone,

I hope you're all doing well. I was wondering what is the most secure way to communicate with a login API to which I send credentials and get Json Web Token in case of a successful login ? Also, where should I store the JWT while the app is running ?

I red in the documentation that "ATS requires that HTTP connections use HTTPS", so I thought that using URLSession is a good and secure solution.

I'm quite new to SwiftUI and trying to learn what is the most secure way to communicate sensitive data to web API.

Thanks in advance for your answers