Skip to content

Commit

Permalink
Remove unnecessary name_identifier_format from spec and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
samudary committed Dec 6, 2019
1 parent 7c316c5 commit d95e4ca
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,36 @@ it 'logs the sso user in' do
end
end
```

### Generating a SAML Response

The gem provides a `SamlResponse` class used to generate a custom signed unencrypted XML SAML response. The SAML response is currently generated by the `ruby-saml-idp` gem and that functionality will be replaced with this class in a later update.

**Usage**

```ruby
# Instantiate with your IDP settings, user attributes and service provider details
saml_response = FakeIdp::SamlResponse.new(
saml_acs_url: "http://localhost.dev:3000/auth/saml/devidp/callback",
saml_request_id: "_#{SecureRandom.uuid}",
name_id: "[email protected]",
audience_uri: "http://localhost.dev:3000",
issuer_uri: "http://publichost.dev:3000",
algorithm_name: :sha256,
certificate: "YOUR IDP CERTIFICATE HERE",
secret_key: "YOUR IDP SECRET KEY HERE",
encryption_enabled: false,
user_attributes: {
uuid: "12345",
username: "bob_builder",
first_name: "Bob",
last_name: "The Builder",
email: "[email protected]",
},
)

# Returns a signed unencrypted XML SAML response document
saml_response.build
```

**Note**: Encrypted assertions will be supported in a future update.
1 change: 0 additions & 1 deletion spec/saml_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

it "generates a valid SAML response" do
settings = OneLogin::RubySaml::Settings.new(
name_identifier_format: "urn:oasis:names:tc:SAML:1.1:nameid-format:unidentified",
allowed_clock_drift: 10000000,
assertion_consumer_service_url: configuration.callback_url,
idp_cert: configuration.idp_certificate,
Expand Down

0 comments on commit d95e4ca

Please sign in to comment.