jeudi 21 juin 2018

Laravel API login with username and token

I am developing a laravel API(MyAPI) with the 5.1 version.I am connecting to this API from a widget which hosted in another website.it has a separate API(hostAPI). I need to authenticate user when widget loaded.

following are my requirement.

" When the widget loads it will attempt to authenticate. It will send a request to the MyAPI with

{
 username: username,
 token: token
}

MyAPI will POST this information on to the hostAPI. This will return either success or a 401.

On sucess, we log the user in. We may need to create an account if an user with that name does not exist"

how can i auth a user with only username and a token key enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire