This assumes that shibboleth is installed on the server running the rails application. It should be possible to use SAML to authenticate by shibboleth without installing it on the server.
gem 'omniauth-shibboleth' and then bundle
In this example, the user id field is the employee number provided by shibboleth
Rails.application.config.middleware.use OmniAuth::Builder do
provider :shibboleth, :uid_field => :employeeNumber
end
The user's information is available in request.env["omniauth.auth"]. Use this information to login or create a user in your system.