Custom email verification laravel fortify - php

I apologize in advance if you don't understand at any point.
context** I am building a web application in Laravel, although I am very new, I am doing well. I implemented the laravel fotify package for user authentication and others, all perfect. Now, in the same way, I use Laravel Socialite to allow login and registration with Google.
now, according to laravel fortify I can implement email verification, which I did according to the documentation and it works perfect. My question or use case that I would like to solve is:
that users who logged in with google are not asked for this verification, since I consider it a bit redundant, however I still have not found the solution.
In my users table, I have a type_auth field where I store the type of authentication that was done. example: google
My idea is to cancel the verification using this field.
I would appreciate any ideas or if this is impossible.
thank you.

Related

Laravel: Layered Authentication ("Remember Me")

I've been working on a "single sign on" framework for a company so that they can consolidate four copies of their employee database into one on their intranet server. I've got the functionality almost complete, but then I ran into one requirement problem.
When they go to https://secure.example.com, they want everything behind authentication and they MUST HAVE "remember me" functionality which is no problem. However, when they go to https://supersecure.example.com they want to force the user to "reauthenticate" for this single session.
I suppose it is also worth noting that https://supersecure.example.com and https://secure.example.com are two separate laravel projects.
A comparable example would be your phone making you type in your password every time you opened the store app.
TL;DR How do I disallow Auth::viaRemember() on specific routes?
What you need is something like OAUth2 server. May be check in to www.okta.com that will give you all the build in functionality for achieving this. Or alternatively write your own Authorization server and integrate your own custom api in Laravel 5. Google and Facebook also provide this type of SDK.

Laravel - Allowing Authenticated and Non Authenticated users to post

I'm wondering if someone could shed some light on an issue im having.
I am following a tutorial on Laracasts about building a forum using Laravel ( 5.4 ) and TDD.
At the moment we have developed the authentication system and now its moving on to actually posting a 'thread'.
In the tutorial, only logged in users can post, then the post is associated with the user that posted it.
But, how would i go about allowing non-logged in users to post as well.
What would be the best approach to take to this?
Any help would be greatly appreciated.
Solution, maybe not good : Create anonymous user in your users table (with ID = 0 for example). And after if user is not logged in to post a thread, you use anonymous user, and you store IP address in your thread table.
Storing IP Address will permit you to attribute thread when user will decide to create his account (and replace 0 by the real user_id in the futur)
Laravel Provides an authentication which can be injected in the constructor of your controller .
Check this link for your reference
https://laravel.com/docs/5.4/authentication
or Since your watching Laracast what the Laravel from Scratch the part where jeffrey is creating a Blog
Good Luck

Laravel 5 Social Authentification (keep session alive)

I am currently developing a web application with Laravel 5.0 and I authenticate my users with Facebook and Twitter using the socialite plugin.
Everything is working well now, I actually already made a post about it when I was struggling with it when I started. So if you want to see the code I'm running you can refer to my previous article.
But now I would like to keep those sessions "alive"? , I don't want to click on the login button everyday and I am having a hard time finding information about it...
The thing is I am not even sure if I look at the right place.. because I am a real newbie in this area and I don't know If I should read more about the Facebook and Twitter SDK or should I look on the Laravel side only ?
I've must have read the Laravel authentication chapter a hundred times but I really don't know where to start. Remembering a token sounds like the way to go but I have no idea whatsoever how to implement it in my current environment.
This is the method provided by Laravel:
if (Auth::attempt(['email' => $email, 'password' => $password], $remember))
{
// The user is being remembered...
}
But when we use the socialite plugin we have to log in the user with the Auth::loginUsingId(id); method, am I wrong ? So how can we remember the user with this method ? Is it possible ? Is it the way to go ?
I hope my problem is clear enough. So if anyone could tell me where should I focus my researches that would be great !

Laravel Login with outside data

I'm using laravel. I know it has a functionality to do login really easy. But, as far as I know it just work with the laravel database. However, I have the database outside of my server so I am using an API to get everything I need. My question is how can I still use the Authentication function using my API?
It is really easy to connect to the API and check if the user and password match, but after that How can I keep using the auth function of laravel for logout, guest and auth pages, etc.
Other example that may work if it is easier to you understand it that way is imagine that I have my users on a text file instead on a database.
Please help me and thanks in advance.
You could use Auth::login($user); to simply do it after verifying credentials using API

CodeIgniter Authentication Libraries with user confirmation by admin

I'm looking for a CodeIgniter Authentication Libraries so I can confirm user registration by admin role (not by sending confirmation email). Can anyone give me a suggestion ? Thanks alot.
No matter which one you choose, you should be expecting to modify it somewhat to suite your specific requirements. CI framework and the CI classes you find online are not complete solutions... they are just starting points. I really prefer Ion Auth myself, but again I needed to make some modifications for my application.

Categories