sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
cookies[:login_type] = "saml"
flash[:notice] = "You are now signed in as #{@user.name} (#{@user.email})"
end
end
```
**The Service provider metadata URL**
This should be found in `/users/auth/saml/metadata`
## Signing and decrypting messages
The idp certificate is straightforward. It can be configured in the [config/initializers/devise.rb](https://gitlab.ruhr-uni-bochum.de/researchdata/rdms/-/blob/feature/shibboleth_auth/hyrax/config/initializers/devise.rb#L299-310).
As for the private key, is at as described [here](https://iam.harvard.edu/saml-signing-and-encryption-certificates), under the part Generate a secure private key?
Is the IDP going to use the SPs public certificate to encrypt message and the SP, then uses the private key, to decrypt the message from the IDP?
If so, from the [onelogin ruby-saml wiki](https://github.com/onelogin/ruby-saml#signing-and-decryption)(which omniauth-saml uses) we just need to add these two to the settings
The [configuration in devise](https://gitlab.ruhr-uni-bochum.de/researchdata/rdms/-/blob/feature/shibboleth_auth/hyrax/config/initializers/devise.rb#L299-310), would then look like this, and fingers crossed this does the trick.