Currently, I have a Django-backend site with rest-framework-auth setup and functioning as far as the default web portal. I see many tutorials on how to remain authenticated with token authentication, but nothing that shows how to perform the initial authentication where you receive the authentication token. How do I make the initial request with the username and password to receive the token?
After authentication, although code is not written yet, I want to look into storing the authentication token with the IOS Keychain API so the user can login once and stay logged in like most apps.
I have previously tried solutions such as the following SO Answer and tutorial page: -https://stackoverflow.com/a/42532121/11915500 -https://developerslogblog.wordpress.com/2017/02/26/basic-authentication-in-swift-3-0/
However, with both of the above, for me, inputting valid authentication credentials returned a 400 status code, and invalid credentials returned a 403 status code.
I would prefer to do this using native classes like NSURLSession rather than installing Alamofire or similar libraries if possible.
Sorry for no source code, but I have nothing to go off of with this issue. Also, if there are any issues with the nature of the question, I apologize again, this is my first post.