WSO2 Identity Server already offers multiple federated authenticators like Facebook, Google, twitter, etc. Out-of-the-box. In case you want to write a custom authenticator, WSO2 Identity Server has an API which acts as an extension point to create a custom authenticator.
This is the official documentation on that: https://is.docs.wso2.com/en/5.10.0/develop/writing-a-custom-federated-authenticator/#!zz
hope it helps :)