We currently have a website that has user account functionality, but we are looking to provide an API to allow users to manage their accounts/perform actions via other devices/websites, by providing an API for common tasks.
Currently the website login is done via HTTPS for security, and then managed using PHP sessions with suitable security measures to guard against session hijacking etc.
How would we provide this functionality in an API?
How is it possible to submit a login without doing a POST? (As presumably GET is the only way to do this via an API call). Is isuing a URL like: https://www.example.com/login/user-foo@password=bar secure? Does the https setup happen before the URL is sent over the wire?
If I can sort that out then I would have the login return an access token. The first request should include this token, and the response should return a new token, for use on the second request and so on....
Would this work?