dimanche 6 novembre 2016

How to create my custom auth verification with Laravel & jwt-auth

I am facing a problem creating my custom login, I had no where else to ask, so I created this issue to discuss the matter.

  • If I want to have more than one form of authentication for social networks, facebook, by twitter, SMS, the current authentication does not do this because the credentials not using relationship's table.

  • I also can not get the information of which channel the user is authenticated.

  • I would very much like to have a way to extend the JWTGuard to customize this check login.

My SQL of suggestions:

accounts.users table:

|- id integer PRIMARY_KEY AUTO_INCREMENT
|- email varchar(50) UNIQUE NOT NULL,
|- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP

accounts.users_auth table is create the access by different types, look at this:

|- id
|- user_id integer NOT NULL, // foreign key of `users` table
|- access_type char(2) NOT NULL, // 'fbook', 'twter', 'msoft', 'googl', 'form'
|- created_at // date of created this access

accounts.form table contains the user password in my own database, look at this:

|- id
|- user_auth_id integer NOT NULL, // foreign key of `users_auth` table
|- password varchar (20) NOT NULL, // user password in my own database
|- last_time // last time of this access by facebook credentials

accounts.facebook table verify the last time of this access by facebook credentials, look at this:

|- id
|- user_auth_id integer NOT NULL, // foreign key of `users_auth` table
|- fb_id varchar (20) NOT NULL, // facebook user id 
|- last_time // last time of this access by facebook credentials

and other socials media...

Is is possible to make JWTAuth?

Thanks for the time you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire