I am not sure how to address the question properly, but I know I am confused here. I do not meant you to code nor give scripts for me, all I am asking is guidance.
I have setup an API (framework built in PHP) to serve resources for apps, mainly iOS and Android. I have also read implementations about Amazon REST API, Facebook oAuth, Twitter xAuth, etc. My concern is regarding authentication (encryption probably) from the view point of the app.
So initially, the user will download the app then install it. The very first thing the user will see in the app is a login page: username and password. User fills it up then submits. That's where my problem is. I am concerned of how the app will pass the username and password to the API. Of course, the credentials must be encrypted so I can decrypt it on the server, but I am confused of the specific process.
I am not a mobile developer so maybe that is the reason why I know nothing of the process. Please enlighten me.
EDIT:
The username and password on the login is not the credentials to be use to access the API but rather the credentials for his account so the API knows if the user is a valid one then return details for its profile.
crypt(), does Android & iOS has similar?