By: Raji Manoharan user 02 Apr 2017 at 7:44 p.m. CDT

6 Responses
Raji Manoharan gravatar
Please help me to point out the step by step guide or document to create a custom name id policy with email Address and with the unspecified.i.e Gluu nameID format - urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified Email Address urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress **Use Case**: Trying to integrate Glue as IDP with Service Now As SAML SP. (Outbound SAML). **What's working ** ServiceNow (SP) SAML properties are configured as required. Gluu (IdP) properties have been configured as required. ServiceNow can successfully redirect users to the Gluu login page. Gluu (IdP) can authenticate user successfully. Gluu (IdP) sends SAML response back to ServiceNow. **What's not working ** Based on the current SAML configuration on both the systems, ServiceNow can successfully validate the Gluu response without giving any errors in the logs. However, Gluu (IdP) is sending 156 character string in the NameID tag of the SAML response which is not recognised by ServiceNow (As per logs the user cannot be found to log them in). The expected value in the NameID tag of the SAML response should be username / email to find the correct user and log them in. ServiceNow. Collectively we tried all the 4 combinations of nameID format in both the systems but none of the combination gave us the positive results. For some of the combinations we didn't even get a valid SAML response in SN and for some combination Gluu couldn't validate the nameID format. **Pasting the SAML response below:** <?xml version="1.0" encoding="UTF-8"?> <saml2p:Response Destination="https://instance.service-now.com/navpage.do" ID="_6f846baabec143bc3853c153d767282b" InResponseTo="SNC21359d3ca3a3934ec6d3c9ce9af85cf6" IssueInstant="2017-03-30T05:41:42.048Z" Version="2.0" xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"><saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">https://domain/idp/shibboleth</saml2:Issuer><saml2p:Status><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></saml2p:Status><saml2:Assertion ID="_20809931162394f8a4345ae484b57778" IssueInstant="2017-03-30T05:41:42.048Z" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"><saml2:Issuer>https://domain/idp/shibboleth</saml2:Issuer><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> <ds:Reference URI="#_20809931162394f8a4345ae484b57778"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> <ds:DigestValue>pP6yySGkRiPQ3qa6uReM6xoWWIc/ONZrNwqBzx7lzG4=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue> // A valid key </ds:X509Data></ds:KeyInfo> </ds:Signature> <saml2:Subject><saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://domain/idp/shibboleth" SPNameQualifier="https://instance.service-now.com">AAdzZWNyZXQxg5ZDpfdjyJrRIMoOVsudgx+qZGBYIPOJzCyfdfpqWC28NCFNfHCN0Ev8hEl6Nbc9uUJI+J7zRtxAdvIe8/Z9DmlzxWpdwec0ggIZPgpypMMqokcKv+hLR6zsjqmPUP7Vd6nL1QMSL96Igjc=</saml2:NameID><saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml2:SubjectConfirmationData Address="127.0.0.1" InResponseTo="SNC21359d3ca3a3934ec6d3c9ce9af85cf6" NotOnOrAfter="2017-03-30T05:46:42.056Z" Recipient="https://instance.service-now.com/navpage.do"/></saml2:SubjectConfirmation></saml2:Subject><saml2:Conditions NotBefore="2017-03-30T05:41:42.048Z" NotOnOrAfter="2017-03-30T05:46:42.048Z"><saml2:AudienceRestriction><saml2:Audience>https://instance.service-now.com</saml2:Audience></saml2:AudienceRestriction></saml2:Conditions><saml2:AuthnStatement AuthnInstant="2017-03-30T05:41:42.000Z" SessionIndex="_5f63709ca63f1c24910e9816428a2c8b"><saml2:SubjectLocality Address="127.0.0.1"/><saml2:AuthnContext><saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef></saml2:AuthnContext></saml2:AuthnStatement><saml2:AttributeStatement><saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"><saml2:AttributeValue>krutik.patel</saml2:AttributeValue></saml2:Attribute><saml2:Attribute FriendlyName="mail" Name="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"><saml2:AttributeValue>krutik.patel@example.com</saml2:AttributeValue></saml2:Attribute></saml2:AttributeStatement></saml2:Assertion></saml2p:Response>

By Raji Manoharan user 02 Apr 2017 at 11:16 p.m. CDT

Raji Manoharan gravatar
idp-process.log with custom email attribute name id urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress root@gluusvr:/opt/gluu/jetty/identity/conf/shibboleth3/idp# tail -f /opt/shibboleth-idp/logs/idp-process.log 2017-04-03 04:10:48,292 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:51] - Property [oxauth.token.validation.url] loaded from oxTrust.properties 2017-04-03 04:10:48,292 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:51] - Property [oxauth.userinfo.url] loaded from oxTrust.properties 2017-04-03 04:10:48,292 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:51] - Property [oxauth.client.id] loaded from oxTrust.properties 2017-04-03 04:10:48,292 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:51] - Property [oxauth.client.password] loaded from oxTrust.properties 2017-04-03 04:10:48,415 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:151] - validate check session status:200 2017-04-03 04:10:48,416 - INFO [org.gluu.oxauth.client.validation.OAuthValidationFilter:157] - Session validation successful. User is logged in 2017-04-03 04:10:48,504 - INFO [net.shibboleth.idp.authn.impl.ValidateExternalAuthentication:115] - Profile Action ValidateExternalAuthentication: External authentication succeeded for user: sanvi@example.com 2017-04-03 04:10:48,630 - WARN [org.opensaml.saml.saml2.profile.impl.AddNameIDToSubjects:337] - Profile Action AddNameIDToSubjects: Request specified use of an unsupportable identifier format: urn:oasis:names:tc:SAML:1.1:nameid-format:email 2017-04-03 04:10:48,635 - WARN [org.opensaml.profile.action.impl.LogEvent:76] - An error event occurred while processing the request: InvalidNameIDPolicy 2017-04-03 04:10:48,656 - INFO [Shibboleth-Audit.SSO:241] - 20170403T041048Z|urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect|SNC0fd2f8ec8325c97d14f6d886209b0b37|https://dev33269.service-now.com|http://shibboleth.net/ns/profiles/saml2/sso/browser|https://domain/idp/shibboleth|urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST|_9dacc4d83f4b10d4fe469fe5f317cd21|sanvi@example.com|||||

By Mohib Zico Account Admin 03 Apr 2017 at 1:15 a.m. CDT

Mohib Zico gravatar
Hi Raji, Can you please share which doc you followed? And.. btw.. thanks for great description.

By Raji Manoharan user 03 Apr 2017 at 1:38 a.m. CDT

Raji Manoharan gravatar
Hi Mohib, Appreciate a quick resolution, to this issue. Please let me know if you need more information to help fix this issue. Please treat this as a priority, I also see this issue is posted on other thread since March 3rd. https://support.gluu.org/single-sign-on/3853/nameid-attribute-for-google-apps-g-suite-integration/ I followed this 3.0.1 doc on customer attributes and for defining name id under same name id. https://gluu.org/docs/ce/3.0.1/admin-guide/attribute/#custom-attributes

By Raji Manoharan user 03 Apr 2017 at 7:10 p.m. CDT

Raji Manoharan gravatar
Pasting the 1.same-nameid.xml 2. attribute-resolver.xml 3.SP meta data Appreciate your help in resolving this issue on priority and please let me know if you need more information. 1.Saml-nameid.xml =============== root@gluusvr:/opt/shibboleth-idp/conf# cat saml-nameid.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p" xmlns:c="http://www.springframework.org/schema/c" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd" default-init-method="initialize" default-destroy-method="destroy"> <!-- ========================= SAML NameID Generation ========================= --> <!-- These generator lists handle NameID/Nameidentifier generation going forward. By default, transient IDs for both SAML versions are enabled. The commented examples are for persistent IDs and generating more one-off formats based on resolved attributes. The suggested approach is to control their use via release of the underlying source attribute in the filter policy rather than here, but you can set a property on any generator called "activationCondition" to limit use in the most generic way. Most of the relevant configuration settings are controlled using properties; an exception is the generation of arbitrary/custom formats based on attribute information, examples of which are shown below. --> <!-- SAML 2 NameID Generation --> <util:list id="shibboleth.SAML2NameIDGenerators"> <ref bean="shibboleth.SAML2TransientGenerator" /> <!-- Uncommenting this bean requires configuration in saml-nameid.properties. --> <!-- <ref bean="shibboleth.SAML2PersistentGenerator" /> <bean parent="shibboleth.SAML2AttributeSourcedGenerator" p:format="urn:oasis:names:tc:SAML:2.0:nameid-format:email" p:attributeSourceIds="#{ {'emailID'} }" /> </util:list> --> <!-- SAML 1 NameIdentifier Generation --> <util:list id="shibboleth.SAML1NameIdentifierGenerators"> <ref bean="shibboleth.SAML1TransientGenerator" /> <bean parent="shibboleth.SAML1AttributeSourcedGenerator" p:format="urn:oasis:names:tc:SAML:1.1:nameid-format:email" p:attributeSourceIds="#{ {'emailID'} }" /> </util:list> </beans> 2. attribute-resolver.xml ========================= root@gluusvr:/opt/shibboleth-idp/conf# cat attribute-resolver.xml <?xml version="1.0" encoding="UTF-8"?> <resolver:AttributeResolver xmlns:resolver="urn:mace:shibboleth:2.0:resolver" xmlns:ad="urn:mace:shibboleth:2.0:resolver:ad" xmlns:dc="urn:mace:shibboleth:2.0:resolver:dc" xmlns:enc="urn:mace:shibboleth:2.0:attribute:encoder" xmlns:sec="urn:mace:shibboleth:2.0:security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd urn:mace:shibboleth:2.0:resolver:ad http://shibboleth.net/schema/idp/shibboleth-attribute-resolver-ad.xsd urn:mace:shibboleth:2.0:resolver:dc http://shibboleth.net/schema/idp/shibboleth-attribute-resolver-dc.xsd urn:mace:shibboleth:2.0:attribute:encoder http://shibboleth.net/schema/idp/shibboleth-attribute-encoder.xsd urn:mace:shibboleth:2.0:security http://shibboleth.net/schema/idp/shibboleth-security.xsd"> <!-- ========================================== --> <!-- Attribute Definitions --> <!-- ========================================== --> <resolver:AttributeDefinition xsi:type="ad:Simple" id="emailID" sourceAttributeID="emailID"> <resolver:Dependency ref="siteLDAP" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oasis:names:tc:SAML:1.1:nameid-format:email" friendlyName="emailID" encodeType="false" /> </resolver:AttributeDefinition> <resolver:AttributeDefinition xsi:type="ad:Simple" id="mail" sourceAttributeID="mail"> <resolver:Dependency ref="siteLDAP" /> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" friendlyName="mail" encodeType="false" /> </resolver:AttributeDefinition> <!-- ========================================== --> <!-- Data Connectors --> <!-- ========================================== --> <resolver:DataConnector id="siteLDAP" xsi:type="dc:LDAPDirectory" ldapURL="%{idp.attribute.resolver.LDAP.ldapURL}" baseDN="%{idp.attribute.resolver.LDAP.baseDN}" principal="%{idp.attribute.resolver.LDAP.bindDN}" principalCredential="%{idp.attribute.resolver.LDAP.bindDNCredential}" useStartTLS="%{idp.attribute.resolver.LDAP.useStartTLS:true}"> <dc:FilterTemplate> <![CDATA[ (uid=$requestContext.principalName) ]]> </dc:FilterTemplate> <!-- <dc:ReturnAttributes>%{idp.attribute.resolver.LDAP.returnAttributes}</dc:ReturnAttributes> --> <dc:StartTLSTrustCredential id="LDAPtoIdPCredential" xsi:type="sec:X509ResourceBacked"> <sec:Certificate>%{idp.attribute.resolver.LDAP.trustCertificates}</sec:Certificate> </dc:StartTLSTrustCredential> </resolver:DataConnector> </resolver:AttributeResolver> 3. SP Metadata =============== <EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://dev33269.service-now.com"> <SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol"> <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://dev33269.service-now.com/navpage.do" /> <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:email</NameIDFormat> <AssertionConsumerService isDefault="true" index="0" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://dev33269.service-now.com/navpage.do" /> <AssertionConsumerService index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://dev33269.service-now.com/consumer.do"/> </SPSSODescriptor> </EntityDescriptor> 4. custom.schema ================= attributetype ( 1.3.6.1.4.1.48710.1.3.1001 NAME 'emailID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu - emailID person attribute' ) objectclass ( 1.3.6.1.4.1.48710.1.4.101 NAME 'gluuCustomPerson' SUP ( top ) AUXILIARY MAY ( emailID ) X-ORIGIN 'Gluu - emailID person objectclass' )

By Mohib Zico Account Admin 04 Apr 2017 at 1:54 a.m. CDT

Mohib Zico gravatar
Let's try this... doc attached.

By Mohib Zico Account Admin 06 Apr 2017 at 9:22 a.m. CDT

Mohib Zico gravatar
Hi Raji, Did it help?