Auth. Providrs let users log in to your Salesforce org using their non-Salesforce credentials. Implement a custom external authentication provider if your OAuth app doesn’t support OpenID Connect. If your app supports OpenID Connect, you can use one of the authentication providers that Salesforce provides.
External users can log in using their credentials from Facebook©, Janrain©, or another Salesforce organization if you set up authentication providers on the Auth. Providers page in Setup and choose to display them on the community login page.
To configure, check the below link
https://help.salesforce.com/articleView?id=sso_provider_sfdc.htm&type=5
Sample Examples:
https://www.infallibletechie.com/2014/07/how-to-login-into-salesforce-using.html