How to login to cakephp 3 using external website login


I need some help to login to cakephp 3 with external API.

I Have develop a website in cakephp 3.2 and I need to let users that are login in en external site to login into my website using a API that I get from the external site. The logged user in the external site login in my site without inserting credential in my site

My question is how can I accomplish that in cakephp 3.2