jeudi 13 juin 2019

Laravel 5.4 : oauth / oauth2 passport understanding issue

Currently I was install laravel 5.4.36 now it is working fine but i have some confution about table structure,execution & flow.

I was ref:

https://medium.com/modulr/create-api-authentication-with-passport-of-laravel-5-6-1dc2d400a7f

  1. is there any different between oauth & oauth2?
  2. not able to understand relation of user - oauth_client table. user refer to normal user(name,email,password) & is client refer to mobile app, web app or user=client?
  3. what is use of oauth_access_tokens table? 'user' & 'oauth_client' table have 1 to many relation with 'oauth_access_tokens'.
  4. In some reference they mention :

ref : https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2

1st url with param : secret,CLIENT_ID,CALLBACK_URL etc
2nd url with login
3rd response with AUTHORIZATION_CODE
4th application requests Access Token

  1. In laravel ref, they mention all examples with user registration, login where user have to login 1st & the response with access_token & use that token like api key but when "oauth_client table secret column" comes into picture.

Please give me the exact oauth api laravel flow for below project :

I am developing web app & also require mobile app for same web app. now i want to connect mobile app with laravel web app using oauth2. Here mobile & web app works as client from oauth_cline table? every time mobile app user have to do login to access the details? Can access_token expire in some ideal time? How to access data for mobile app where authentication not require (like basic info about company on landing page & all want to fetch from laravel db when mobile app open)?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire