You can do customer logged in Programmatically using Magento 2.
You required only Customer id to logged-in customer programmatically without going to the login page.
You need to first get Customer object using CustomerRepositoryInterface interface. Use Customer Object to customer session with setCustomerDataAsLoggedIn function. Continue reading “Customer Logged in Programmatically using Magento 2.”