onelogin/ruby-saml — pull request #20 by calh (2011-11-03 16:32:21+00:00)
Title: Add dynamically generated SP metadata

This patch adds a class to create SP metadata XML using the settings class. Updated the README as well:

To form a trusted pair relationship with the IdP, the SP (you) need to provide metadata XML
to the IdP for various good reasons. (Caching, certificate lookups, relying party permissions, etc)

The class Onelogin::Saml::Metdata takes care of this by reading the Settings and returning XML. All you have to do is add a controller to return the data, then give this URL to the IdP administrator.
The metdata will be polled by the IdP every few minutes, so updating your settings should propagate to the IdP settings.

```ruby
class SamlController < ApplicationController
# ... the rest of your controller definitions ...
def metadata
settings = Account.get_saml_settings
meta = Onelogin::Saml::Metadata.new
render :xml => meta.create(settings)
end
end
```