Replacing Login

Hi,

We are looking to replace the login with an external provider. I believe this would work in a similar way to how the Facebook integration works.

We are struggling to see how the integration works and hooks in. Could someone give us some pointers as to how to replace the current login with something else? Our provider uses basic auth and JWT, so if we know where to look, it should be relatively simple to connect into the OmniAuth and Devise pieces already in place.

Thanks!