There you go: https://marmelab.com/react-admin/AuthProviderWriting.html#handlecallback
You can also look at examples from other 3rd party authentication providers, like ra-auth-auth0 for instance.