S
S
Sergey2014-07-02 16:55:52
PHP
Sergey, 2014-07-02 16:55:52

How to implement authorization through api?

Hey!
Tell a newbie: there is a service for which a mobile application is being written. There is an API through which the mobile application will interact with the service. How to make authentication (that is, give data via API only to authorized users)?
What options do I have?
Generate a token during authorization, give it to the mobile application, and the mobile application will send this token every time it requests the service. But the question is how to generate this token? That is, it must have reversible encryption, so that, roughly speaking, on the service side, I can find out the user ID from the token? Or generate a token randomly and store it in the database?
Or are there any other ways to more securely authenticate users through the API?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Kheben, 2014-07-02
@mr_Verman

OAuth2.0 and the mandatory use of a secure connection (SSL).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question