Comments (6)
No you need to have 2 separate entity descriptors.
The service provider has it's own entity id and also requires an EntityDescriptor with SPSSODescriptor
The identity provider has another entity id and requires an EntityDescriptor with IDPSSODescriptor
As you are implementing a ServiceProvider, you need to register your current_provider with your own entity_id
In the request_authenication method you need to use the IDP's entity to find the Saml.provider
See the example below
class SamlController < ApplicationController
extend Saml::Rails::ControllerHelper
current_provider "<your_sp_entity_id>"
def request_authentication
provider = Saml.provider("<the_idp_entity_id>")
destination = provider.single_sign_on_service_url(Saml::ProtocolBinding::HTTP_POST)
authn_request = Saml::AuthnRequest.new(destination: destination)
session[:authn_request_id] = authn_request._id
@saml_attributes = Saml::Bindings::HTTPPost.create_form_attributes(authn_request)
render text: @saml_attributes.to_yaml
end
from libsaml.
Thats incorrect, the current_provider has to be configured using the entity id of your service provider.
from libsaml.
Oh got it! So we have to add IDPSSODescriptor into sp metadata right. So that Saml.current_provider.single_sign_on_service_url
can return SSO URL to IdP.
from libsaml.
No you have to add a SPSSODescriptor for the ServiceProvider Metadata.
from libsaml.
The single_sign_on_service_url()
method will find idp_descriptor()
def idp_descriptor(raise_error = true)
entity_descriptor.idp_sso_descriptor || raise_error &&
raise(Saml::Errors::InvalidProvider.new("Cannot find identity provider with entity_id: #{entity_id}"))
end
Isn't finding IDPSSODescriptor in the metadata? 🤔
With the above thinking, I add IDPSSODescriptor in SP Metadata. Here is my sp.xml
file:
<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
validUntil="2020-01-24T05:41:14Z"
cacheDuration="PT604800S"
entityID="https://localhost:4447/saml/metadata">
<md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://localhost:4447/saml/logout"/>
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://localhost:4447/saml/acs"
index="1"/>
</md:SPSSODescriptor>
<md:IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<md:KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<md:X509Data>
<md:X509Certificate>
MIIC8DCCAdigAwIBAgIQc5ZjVSrAAbdBLLBSSGrUAzANBgkqhkiG9w0BAQsFADA0MTIwMAYDVQQDEylNaWNyb3NvZnQgQXp1cmUgRmVkZXJhdGVkIFNTTyBDZXJ0aWZpY2F0ZTAeFw0yMDAxMTQwNTIxNTFaFw0yMzAxMTQwxxxx
</md:X509Certificate>
</md:X509Data>
</md:KeyInfo>
</md:KeyDescriptor>
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://login.microsoftonline.com/xxxx/saml2"/>
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://login.microsoftonline.com/xxxx/saml2"/>
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://login.microsoftonline.com/xxxx/saml2"/>
</md:IDPSSODescriptor>
</md:EntityDescriptor>
from libsaml.
That would make a lot of sense! Thanks for clearing out! Again, have some guidance about this in the Readme is super helpful!
from libsaml.
Related Issues (20)
- what should be the identity id with uri in idp and sp HOT 4
- Provide access to ResponseLocation property HOT 2
- Sign using SHA1 HOT 6
- xmldsig dependency issue HOT 6
- SOAP binding not checking for WantAuthnRequestsSigned HOT 1
- Support multiple entity descriptors in metadata when using Url ProviderStore HOT 1
- KeyInfo node in EncryptedData node HOT 5
- chomp vs gsub("\n", "") on Base64 encoding HOT 2
- Help sought on “Digest value” & “Signature value” HOT 2
- ECP profile support? HOT 7
- Support for SAML responses where only the assertion is signed HOT 2
- Support version of rails <= 4.2 HOT 1
- Onelogin: undefined method `canonicalize' for nil:NilClass HOT 18
- Questions about documentation HOT 20
- Question about SAML Response validation HOT 1
- Redundant use of XmlMini_REXML HOT 2
- Add element SessionNotOnOrAfter HOT 1
- RSpec fails after upgrading(`~> 1.8`) gem `nokogiri`.
- Signature verification with multiple certificates when validating SAML responses HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsaml.