-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary name_identifier_format from spec and update README
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters