« Back

Getting started with Liferay SAML 2.0 Identity Provider

Company Blogs February 27, 2012 By Mika Koivisto Staff

 

Liferay 6.1 EE comes with SAML 2.0 Identity Provider and Service Provider support via SAML plugin. If you are not familiar with SAML check out my Introduction to SAML presentation slides.

In this post we will configure Liferay to be SAML Identity Provider and configure Salesforce to be a Service Provider. After we are done we have a user that can move from Liferay to Salesforce without requiring to authenticate on Salesforce. 

You’ll need following things to complete this by yourself:

* Liferay Portal 6.1 EE GA1 Tomcat bundle
* SAML Portlet WAR
* Salesforce developer account. You can sign-up here for free.

The first thing to do is download and install Liferay. If you need help configuring Liferay refer to Liferay 6.1 User Guide. Once that is done you’ll need to configure the SAML identity provider before deploying the plugin. The IdP needs a private and public key pair for signing SAML messages. It uses Java keystore to store the them. We’ll create the keystore and they key pair using keytool that is part of the JDK. You need to pick a unique entity id for your IdP and a password that is used to protect keystore and the private key. In this example we’ll use liferaysamlidpdemo as the entity id and liferay as the password for both keystore and the key. The keystore is created in LIFERAY_HOME/data/keystore.jks as this is the default location SAML plugin will look for it. You can also configure the location and type of they keystore and will do it here just for reference.

keytool -genkeypair -alias liferaysamlidpdemo -keyalg RSA -keysize 2048 -keypass liferay -storepass liferay -keystore data/keystore.jks

You’ll be asked to provide some information that will be in the certificate with the public key.

What is your first and last name?
  [Unknown]:  Liferay SAML IdP Demo
What is the name of your organization?
  [Unknown]:  Liferay SAML IdP Demo
What is the name of your City or Locality?
  [Unknown]: 
What is the name of your State or Province?
  [Unknown]: 
What is the two-letter country code for this unit?
  [Unknown]: 
Is CN=Liferay SAML IdP Demo, OU=Unknown, O=Liferay SAML IdP Demo, L=Unknown, ST=Unknown, C=Unknown correct?
  [no]:  yes

Next step is to add SAML configuration to your portal-ext.properties.

saml.enabled=true
saml.role=idp
saml.entity.id=liferaysamlidpdemo
saml.require.ssl=false
saml.sign.metadata=true

saml.idp.authn.request.signature.required=true

saml.keystore.path=${liferay.home}/data/keystore.jks
saml.keystore.password=liferay
saml.keystore.type=jks

saml.keystore.credential.password[liferaysamlidpdemo]=liferay

Now you can deploy SAML plugin by copying it to LIFERAY_HOME/deploy and starting up tomcat. Wait for the saml-portlet to be deployed and available and then open http://localhost:8080/c/portal/saml/metadata. If you have configured everything correctly you should see the IdP metadata similar to below. I’ve just shortened the data on signature and certificate elements.

<?xml version=“1.0” encoding=“UTF-8”?>
<md:EntityDescriptor xmlns:md=“urn:oasis:names:tc:SAML:2.0:metadata” entityID=“liferaysamlidpdemo”>
<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/2000/09/xmldsig#rsa-sha1”/>
   <ds:Reference URI=“”>
    <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/2000/09/xmldsig#sha1”/>
    <ds:DigestValue>mVKz/Tv6o40+SrEF595+Gedmoo8=</ds:DigestValue>
   </ds:Reference>
  </ds:SignedInfo>
  <ds:SignatureValue>AAJsDF8dJv5XQw6Ty1MSg7 … OXvQw==</ds:SignatureValue>
  <ds:KeyInfo>
   <ds:X509Data>
    <ds:X509Certificate>MIIDjjCCAnagAwIB… </ds:X509Certificate>
   </ds:X509Data>
  </ds:KeyInfo>
</ds:Signature>
<md:IDPSSODescriptor ID=“liferaysamlidpdemo”
  WantAuthnRequestsSigned=“true” protocolSupportEnumeration=“urn:oasis:names:tc:SAML:2.0:protocol”>
  <md:KeyDescriptor use=“signing”>
   <ds:KeyInfo xmlns:ds=“http://www.w3.org/2000/09/xmldsig#”>
    <ds:X509Data>
     <ds:X509Certificate>MIIDjj …</ds:X509Certificate>
    </ds:X509Data>
   </ds:KeyInfo>
  </md:KeyDescriptor>
  <md:SingleLogoutService Binding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect”
   Location=“http://localhost:8080/c/portal/saml/slo_redirect”/>
  <md:SingleSignOnService Binding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect”
   Location=“http://localhost:8080/c/portal/saml/sso”/>
  <md:SingleSignOnService Binding=“urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST”
   Location=“http://localhost:8080/c/portal/saml/sso”/>
</md:IDPSSODescriptor>
</md:EntityDescriptor>

Even though the IdP is configured and functioning it’s not very useful because there’s no Service Providers configured. For this example we are going to use Salesforce developer account to demonstrate single sign-on between Liferay and Salesforce. If you haven’t already signed up for Salesforce developer account do it here.

We’ll need to export the certificate from keystore because Salesforce doesn’t know how to read SAML metadata.

keytool -export -alias liferaysamlidpdemo -file liferaysamlidpdemo.crt -keystore data/keystore.jks -storepass liferay -keypass liferay

Now login to your Salesforce developer account in here. On your dashboard click on Setup. 

 

Then click on Security Controls > Single Sign-On Settings under Administration Setup.

 

Then click on Edit.

Here’s the setting you need:

* SAML Enabled.
* SAML Version: 2.0
* Issuer: liferaysamlidpdemo (this is the entity id of the IdP)
* Identity Provider Certificate: liferaysamlidpdemo.crt which you exported earlier.
* Identity Provider Login URL: http://localhost:8080/c/portal/saml/sso
* SAML User ID Type: Select Assetion contains User’s salesforce.com username
* SAML User ID Location: Select User ID is in the NameIdentifier element of the Subject statement
* Identity Provider Logout URL: http://localhost:8080/c/portal/logout (Salesforce does not support SAML Single Logout Profile)

 

Verify that your setting as correct and then click on Download Metadata. Also note the Entity Id as this will be needed on the IdP side.

Move the downloaded metadata xml to LIFERAY_HOME/data/saml/salesforce-metadata.xml. Now we need to configure the IdP to know about this Service Provider. This is done by telling saml plugin where to find the SAML metadata for Salesforce.

saml.metadata.paths=${liferay.home}/data/saml/salesforce-metadata.xml

If your Salesforce Entity Id is not https://saml.salesforce.com you’ll also need to add following lines to your portal-ext.properties. Note I’m using https://saml.salesforce.com as the entity id but you would replace it with what ever Salesforce reported it to be.

saml.idp.metadata.attributes.enabled[https\://saml.salesforce.com]=true
saml.idp.metadata.attribute.names[https\://saml.salesforce.com]=
saml.idp.metadata.name.id.format[https\://saml.salesforce.com]=urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
saml.idp.metadata.salesforce.attributes.enabled[https\://saml.salesforce.com]=true

If you had your tomcat still running just restart it so that the new property value is read. Then login as test@liferay.com / test. Now click on Manage > Site Pages. Click on Add Page. Add following values:

Name: Salesforce
Type: URL
URL:  /c/portal/saml/sso?entityId=https://saml.salesforce.com 

Notice the entityId is the same Entity Id that was shown as entity id on the Salesforce Single Sign-On configuration page.

Go to Control Panel and add a new user with same email address as your Salesforce developer account. Sign out and login with that new account. Now click on the Salesforce page link. If everything was configured correctly you are redirected to Salesforce and you are signed in with your developer account. If you want to be redirected to some other page than they home page you can add a URL parameter RelayState with the page URL you want to be redirected to as the value. For example the URL could look like this /c/portal/saml/sso?entityId=https://saml.salesforce.com&RelayState=/006/o. This would take me to my Opportunities page directly.

Now sign out from Salesforce and you will be taken back to Liferay and logged out from Liferay. Now if you click on the Salesforce page it will take present you with Liferay login page and after login will take you to Salesforce.

Update: If you need to setup Liferay as SP check out my collegues post Setting up Liferay as Service Provider.

Threaded Replies Author Date
Where can I download the SAML Portlet WAR? --... Steven Zhao February 28, 2012 11:26 AM
It's available in Customer Portal like all EE... Mika Koivisto February 28, 2012 11:28 AM
Hi Mika, thanks for your post. i am able to use... Kapil Burange September 16, 2014 5:22 AM
Hi, One more question i want to ask is the... Kapil Burange September 17, 2014 5:05 AM
You'd need to provision the users from your... Mika Koivisto September 17, 2014 5:12 AM
is this the only way to register ldap user in... Kapil Burange September 17, 2014 5:19 AM
we cannot allow LDAP connectivity to Salesforce... Kapil Burange September 17, 2014 5:34 AM
Hi Mika, can you please tell how to pass... Kapil Burange November 20, 2014 3:58 AM
Hi Mika, thanks for the reply. i just want to... Kapil Burange September 24, 2014 7:04 AM
Cool! Thanks Mika! Jonas Yuan February 28, 2012 1:53 PM
Thanks Mika. I got the SAML WAR and it works... Steven Zhao February 29, 2012 9:37 AM
Cool..thnx Mika for sharing this.. Jay Patel March 1, 2012 11:19 AM
great job! Roger CARHUATOCTO March 2, 2012 1:52 AM
Thanks Mika, Very useful blog..... Ankit Srivastava March 14, 2012 1:53 AM
Works very well, however on logout from... Bart Simpson March 20, 2012 4:28 AM
Paul, that's because Salesforce does not... Mika Koivisto March 20, 2012 8:53 AM
Liferay SAML 2.0 IdP support is it only for EE... Anand Anandan March 25, 2012 6:18 PM
The SAML plugin is for EE only. Mika Koivisto March 26, 2012 2:37 PM
[...] I blogged about the Identity Provider... Anonymous March 20, 2012 8:53 AM
I cannot find the SAML portlet war. I looked... Doug Storms May 1, 2012 8:45 AM
Sorry, I didn't realize the customer portal was... Doug Storms May 1, 2012 10:13 AM
We tried to use it. It worked nicely, but not... Armaz Mellati May 1, 2012 11:25 PM
Can some one walk me thru the steps if we want... Vipin Bardia May 15, 2012 4:22 PM
I don't think AD by itself can be SAML IdP but... Mika Koivisto May 15, 2012 4:30 PM
Hi Mika, Thanks for prompt response.I will try... Vipin Bardia May 15, 2012 5:41 PM
Good Information.Thank you Mika Muru Annamalai May 23, 2012 11:32 AM
Armaz Mellati, yeah the current version of the... Mika Koivisto May 23, 2012 11:40 AM
Mika, do you have a timeline for adding support... Petr Zalesky February 27, 2013 11:42 AM
To clarify what "multiple IDPs" mean, Mika are... Christopher Dawson March 26, 2013 2:55 PM
[...] Check this : Link... Anonymous May 25, 2012 2:40 AM
Is the download for the WAR In the "Official... ryan baldwin May 25, 2012 8:07 AM
Ryan, this is a EE only plugin so you need to... Mika Koivisto May 25, 2012 10:52 AM
I have followed the steps to setup liferay as... Harish Kumar July 27, 2012 3:42 AM
Did you login to Liferay before accessing the... Steven Zhao August 30, 2012 7:28 AM
I followed these steps to a T and I keep... Aaron Weikle November 1, 2012 10:13 AM
I have followed the steps but when I try to... Imad T. June 5, 2013 6:44 AM
Has it worked for you, i am getting the... Anup Arya July 8, 2014 11:22 PM
how do i access the source code for SAML... Venkatesh Prasad January 2, 2013 4:41 AM
HI, Thanks for the plugin - in Service... Al Faller February 26, 2013 5:53 AM
I need it for WSRP (remote portlets) - How to... haikel thamri August 1, 2013 3:56 AM
Haikel, we don't currently support SAML with... Mika Koivisto August 1, 2013 11:13 AM
Mika, I went through the setup steps you... Clint Wilde August 27, 2013 3:24 PM
If you got UI then use it only because using... Mika Koivisto August 27, 2013 3:28 PM
MIka, Thanks for the quick response. Just to... Clint Wilde August 27, 2013 3:39 PM
When this blog post was written there was no... Mika Koivisto August 28, 2013 11:45 AM
Thanks Mika, that helps. After submitting the... Clint Wilde August 28, 2013 1:48 PM
Hi Mika, Do you know when was the UI... Ash Gupta September 17, 2013 3:42 PM
The UI should be included in the next release.... Mika Koivisto September 17, 2013 3:52 PM
Hi Mika, Thanks for the quick reply! Can I... Ash Gupta September 17, 2013 3:58 PM
Mika, I apologize in advance for... Clint Wilde September 18, 2013 8:48 AM
Well it depends what you mean by application... Mika Koivisto September 18, 2013 11:44 AM
Thanks Mika. I just received more... Clint Wilde September 18, 2013 12:07 PM
AttributeQuery is not supported at this point.... Mika Koivisto September 18, 2013 12:11 PM
ughh... Thanks. General question to gage... Clint Wilde September 18, 2013 12:23 PM
I took a quick look at the spec to refresh my... Mika Koivisto September 18, 2013 2:48 PM
Thanks Mika. I may take you up on that when we... Clint Wilde September 25, 2013 12:39 PM
Hi Mika, We are also getting this Exception in... Clint Wilde September 25, 2013 12:46 PM
This could be caused by someone accessing... Mika Koivisto September 26, 2013 2:37 PM
Hi Mika, I am following up your... Ajit Gauli September 29, 2013 12:54 PM
First of all Liferay doesn't support transient... Mika Koivisto September 30, 2013 11:30 AM
Did u get this error resolved? If so plz advise. Salman Jan December 4, 2014 1:09 PM
Make sure you are consuming the metadata from... Mika Koivisto September 26, 2013 2:35 PM
Hi Mika, Is there saml plugin developed for... Mahesh Panchal September 16, 2013 9:30 AM
Hi Mika, I am trying to set up liferay... vaibhav kachare October 14, 2013 12:45 PM
Hi Mika, Can you explain the... Ash Gupta October 21, 2013 2:43 PM
Pls ignore the previous question, Not what I... Ash Gupta October 23, 2013 4:36 AM
Hi Mika, I would still like to know all the... Ash Gupta October 23, 2013 4:41 AM
Our documentation team is still working on the... Mika Koivisto October 23, 2013 11:00 AM
Hi Mika, Thanks, I think I got most of the... Ash Gupta October 24, 2013 11:21 AM
The keystore for SSL can and probably should be... Mika Koivisto October 24, 2013 11:29 AM
HI Mika, Thanks! One other question that I... Ash Gupta October 24, 2013 5:36 PM
Encrypted assertions are in the roadmap but not... Mika Koivisto October 24, 2013 6:39 PM
Hi Mika, Thanks for the confirmation on... Ash Gupta November 5, 2013 8:42 AM
Hi Mika, Is the encryption assertion is... Kapil Burange November 5, 2014 5:42 AM
It's not available yet. Mika Koivisto November 5, 2014 7:34 AM
Thank you so much for quick response......:):)... Kapil Burange November 6, 2014 2:01 AM
Hi Folks, the issue I was facing with "Error... vaibhav kachare October 31, 2013 1:44 PM
Vaibhav Can you tell me what patch it was, we... Brett Lewinski November 8, 2013 4:30 PM
Brett, Patch that we receive was... vaibhav kachare November 12, 2013 10:59 AM
thank you,very good article Veera Vasantha Reddy Puram February 11, 2014 10:19 PM
Hi Mika, I've setup the saml plugin as idp and... Thierry Dagnino February 18, 2014 1:55 PM
I'm pretty sure that is fixed but I don't... Mika Koivisto February 18, 2014 2:06 PM
I'm using the version 1.0 for liferay 6.1.2 ga... Thierry Dagnino February 18, 2014 2:14 PM
Hi , I installed the 1.0.1 version and still... Thierry Dagnino February 18, 2014 3:10 PM
Have you set portal.ctx property to your portal... Mika Koivisto February 25, 2014 3:23 PM
I dug deeper and looks like there is really a... Mika Koivisto February 26, 2014 11:41 AM
Hi Mika, I had opened a ticket with liferay... Thierry Dagnino February 26, 2014 11:48 AM
Hi MIka, Is there a multiple idp support in the... eskendir Berhan June 9, 2014 4:47 PM
[...] If you are not familiar with SAML, check... Anonymous April 11, 2014 5:44 AM
As you state in the blog, Salesforce does not... Thierry Dagnino April 25, 2014 7:21 AM
I see this same issue in the environment I am... Dwayne Miller May 9, 2014 7:14 AM
[...] Getting started with Liferay SAML 2.0... Anonymous May 21, 2014 2:34 AM
Hi Mika, Your "Getting started with Liferay... Chong Hong October 2, 2014 3:41 AM
Hi Mika, This is a good starter for this useful... Peter J Shields November 14, 2014 7:57 AM

Where can I download the SAML Portlet WAR? -- Thanks
Posted on 2/28/12 11:26 AM.
It's available in Customer Portal like all EE plugins.
Posted on 2/28/12 11:28 AM in reply to steven zhao.
Cool! Thanks Mika!
Posted on 2/28/12 1:53 PM.
Thanks Mika. I got the SAML WAR and it works like a charm!. Just one more question. How do I use Liferay as IdP to connect to two SPs? say one is Salesforce and another is Google App. And I would use different Liferay user fields other than email address as SSO subject, or two different email addresses, one for Salesforce, one for Google App.
Posted on 2/29/12 9:37 AM.
Cool..thnx Mika for sharing this..
Posted on 3/1/12 11:19 AM.
Posted on 3/2/12 1:52 AM in reply to Jay Patel.
Thanks Mika, Very useful blog.....
Posted on 3/14/12 1:53 AM.
Works very well, however on logout from salesforce, it's redirected to /c/portal/logout
Posted on 3/20/12 4:28 AM in reply to Ankit Srivastava.
[...] I blogged about the Identity Provider setup few days ago. See Getting Started with Liferay SAML 2.0 Identity Provider. Flag Please sign in to flag this as inappropriate. Mark as an Answer [...] Read More
Posted on 3/20/12 8:53 AM.
Paul, that's because Salesforce does not support SAML Single Logout profile.
Posted on 3/20/12 8:53 AM in reply to Paul ..
Liferay SAML 2.0 IdP support is it only for EE edition. Is it not available for CE.
Can CE be part of SP? Please let us know. Thank you.

-Anand
Posted on 3/25/12 6:18 PM in reply to Mika Koivisto.
The SAML plugin is for EE only.
Posted on 3/26/12 2:37 PM in reply to Anand Anandan.
I cannot find the SAML portlet war. I looked for the Customer Portal, but could not find that either. Is this available with the 30 day free trial of 6.1 EE? I found the liferay-asb-sso-hook-1.0.1.war, is this what I need? Whenever I hit, http://localhost:8080/c/portal/saml/metadata, it redirects me to http://localhost:8080. Thanks.
Posted on 5/1/12 8:45 AM.
Sorry, I didn't realize the customer portal was for actual customers and not trial users. The sales office gave me access to the necessary jar. Thanks again.
Posted on 5/1/12 10:13 AM in reply to Doug Storms.
We tried to use it. It worked nicely, but not for us emoticon We need to have both SAML and plain-authentication available for users. Users must get forwarded to the login-page where they can choose. This was not possible (read: we didn't find out how) to set-up with SAML-plugin. When activated, all logins, are redirected right to the SAML (federatedt) in-logging-page only.
Posted on 5/1/12 11:25 PM in reply to Doug Storms.
Can some one walk me thru the steps if we want to use our AD as the identity provider and use Liferay as the Service provider. This may help us to resolve our LDAP issue.
Posted on 5/15/12 4:22 PM in reply to Armaz Mellati.
I don't think AD by itself can be SAML IdP but with Microsoft's Active Directory Federation Server (ADFS) 2.0 I think you could do that. The principals are the same but I can't help you with ADFS configuration as I've never used it.
Posted on 5/15/12 4:30 PM in reply to vipin bardia.
Hi Mika,

Thanks for prompt response.I will try your suggestion with my seniors and if we succeed , will also update you.

Thanks,
Vipin Bardia
http://vkbardia.blogspot.in
Posted on 5/15/12 5:41 PM in reply to Mika Koivisto.
Good Information.Thank you Mika
Posted on 5/23/12 11:32 AM in reply to Vipin Bardia.
Armaz Mellati, yeah the current version of the SP is very limited. I'll keep that in mind for the next version as I already had thought about adding support for multiple IdPs so that would fit right in with it.

Thanks everyone for your feedback. I'm always interested in hearing how and with what other SAML IdP or SP you are using it with. Also I'm very interested in hearing what features you think it's missing. Feel free to post here or email me firstname.lastname @ liferay.com
Posted on 5/23/12 11:40 AM in reply to Muru Annamalai.
[...] Check this : Link http://www.liferay.com/web/mika.koivisto/blog/-/blogs/12725251 Link]... [...] Read More
Posted on 5/25/12 2:40 AM.
Is the download for the WAR In the "Official Plugins"? When I do a search for SAML I can't find it. I can find the AssureBridge SAML war in the community plugins, but can't find the official one... Point me in the right direction?
Posted on 5/25/12 8:07 AM in reply to .
Ryan, this is a EE only plugin so you need to be EE subscriber to get it. For EE subscribers it's found in the customer portal where you download EE version of the portal etc.
Posted on 5/25/12 10:52 AM in reply to ryan baldwin.
I have followed the steps to setup liferay as idp but when I try to access

http://localhost:8080/c/portal/saml/metadata

Its redirecting me to home page instead of displaying metadata.
Posted on 7/27/12 3:42 AM in reply to Mika Koivisto.
Did you login to Liferay before accessing the page? The URL pointed to a private page I believe
Posted on 8/30/12 7:28 AM in reply to Harish Kumar.
I followed these steps to a T and I keep getting:

Error [KeyStoreManagerImpl:122] Unable to load Keystore
java.io.IOException: Keystore was tampered with, or password was incorrect

I have checked numerous times to make sure all information in my portal-ext.properties file is correct and it is. So not sure why I am getting this error.
Posted on 11/1/12 10:13 AM in reply to Steven Zhao.
how do i access the source code for SAML portlet plugin?
Posted on 1/2/13 4:41 AM.
HI, Thanks for the plugin - in Service Provider mode, is it capable of getting a user's groups from attributes? I am an EE user, and am potentially interested in using this plugin.

Thanks,

Al
Posted on 2/26/13 5:53 AM.
Mika, do you have a timeline for adding support for multiple IdPs?
Posted on 2/27/13 11:42 AM in reply to Mika Koivisto.
To clarify what "multiple IDPs" mean, Mika are you referring to the ability of a single LR server in IDP mode to support using different certificates for signing assertions to different service providers? The SAML plugin in its current state allows me to configure multiple SPs for an IDP Initiated Web SSO scenario - but even if I configure 50 different SPs I would be signing all of those assertions with the same single certificate, right?

I have a client that is requiring that I provide them with a unique certificate for each of their SP entityIDs.

What I believe I would need is a way to configure multiple IDP entity IDs - each with their own keystore certificate - and then a way to associate that specific entityID with a specific SP entityID. That way I could utilize a different certificate for each SSO "route".

Example portal-ext.properties with proposed config changes:

saml.enabled=true
saml.role=idp
saml.metadata.paths=\
/first.service.provider.metadata.xml, \
/second.service.provider.metadata.xml
?? saml.entity.id=https://generic.identity.provider.entity.id ??
saml.idp.enabled=true

# First IDP Entity ID Config
saml.idp.entity.id[https\://first.service.provider.entity.id]=https\://fir­st.identity.provider.entity.id
saml.keystore.credential.password[https\://first.i­dentity.provider.entity.id]=<key-password>

# Second IDP Entity ID Config
saml.idp.entity.id[https\://first.service.provider.entity.id]=https\://fir­st.identity.provider.entity.id
saml.keystore.credential.password[https\://first.i­dentity.provider.entity.id]=<key-password>

Mika:
Is this something that is in the works at all? Or should I accept the fact that I'll need to roll my own to get this kind of functionality. Will try contacting you via email also.

Cheers!
Posted on 3/26/13 2:55 PM in reply to Petr Zalesky.
I have followed the steps but when I try to access the url "http://localhost:8080/c/portal/saml/metadata" I got "Internal Server Error"

Any suggestions ?
Posted on 6/5/13 6:44 AM in reply to Harish Kumar.
I need it for WSRP (remote portlets) - How to make it work? does liferay support that?
Posted on 8/1/13 3:56 AM.
Haikel, we don't currently support SAML with WSRP although it is on our future roadmap.
Posted on 8/1/13 11:13 AM in reply to haikel thamri.
Mika,

I went through the setup steps you outlined, but I am getting a null pointer exception. The authnRequest is coming back null after this line in: com.liferay.saml.profile.WebSsoProfileImpl:

AuthnRequest authnRequest = samlMessageContext.getInboundSAMLMessage();

I am trying to debug why and have this question: do I need to generate a keystore.js from the command line AS WELL AS in the SAML UI? They both seem to be doing the same exactly thing so do I need to do both of them or just from the command line?

Thank you.
Posted on 8/27/13 3:24 PM in reply to Mika Koivisto.
If you got UI then use it only because using both will just make a mess. Make sure your Idp knows about your SP and vise versa.
Posted on 8/27/13 3:28 PM in reply to Clint Wilde.
MIka,

Thanks for the quick response.

Just to be clear, I am talking about the form to generate a Certificate and Private Key in the General tab of the SAML portlet. I ask because you didn't mention that in your initial instructions, and it seems to require the same inputs as the command line you mentioned.

I did submitted the form, but will that cause a mess if I also specify the jeystore.jks file in portal-ext.properties as you said?


Thanks again,
Clint
Thank you!
Posted on 8/27/13 3:39 PM in reply to Mika Koivisto.
When this blog post was written there was no UI. The UI writes to the same keystore specified in the portal-ext.properties if FileSystemKeyStoreManagerImpl is in use and it is the default one for backwards compatibility.
Posted on 8/28/13 11:45 AM in reply to Clint Wilde.
Thanks Mika, that helps.

After submitting the form, restarting Tomcat and refreshing the page:

com.liferay.saml.SamlException: org.opensaml.ws.message.decoder.MessageDecodingException: No SAMLRequest or SAMLResponse query path parameter, invalid SAML 2 HTTP Redirect message
at com.liferay.saml.profile.WebSsoProfileImpl.processAuthnRequest(WebSsoProfileImpl­.java:127)
at com.liferay.saml.profile.WebSsoProfileUtil.processAuthnRequest(WebSsoProfileUtil­.java:36)2

Am I missing a parameter somewhere?

Here's the saml props from my portal-ext.properties:

saml.enabled=true
saml.role=idp
saml.entity.id=liferaysamlid­pdemo
saml.require.ssl=false
saml.sign.metadata=true
saml.idp.authn.request.signatu­re.required=true
saml.keystore.path=${liferay.home}/SAML-DATA/keystore.jks
saml.ke­ystore.password=liferay
saml.keystore.type=jks
saml.keystore.credential.password[l­iferaysamlidpdemo]=liferay
saml.metadata.paths=${liferay.home}/SAML-DATA/salesfor­ce-metadata.xml


Thanks,
Clint
Posted on 8/28/13 1:48 PM in reply to Mika Koivisto.
Hi Mika,

Is there saml plugin developed for 6.0.12 EE ?
Posted on 9/16/13 9:30 AM.
Hi Mika,
Do you know when was the UI introduced?
I'm on 3.1.20 ee ga2 and I don't have UI.
I have configured SAML sso between 2 instances of LR (IdP and SP) and it seems to be working well to an extent (can't seem to get custom user fields working) but I can't even see SAML portlet anywhere in the portal, except for in portal properties in system administration. Now wondering if my installion is ok or If I'm missing something.
Thanks
Ash
Posted on 9/17/13 3:42 PM in reply to Mika Koivisto.
The UI should be included in the next release. When it will be made generally available I don't know the latest should be with 6.2 EE.
Posted on 9/17/13 3:52 PM in reply to Ash Gupta.
Hi Mika,
Thanks for the quick reply!

Can I also draw your attention to another question I posted related to SAML here -
https://www.liferay.com/community/forums/-/message_boards/view_message/28886644­

Apologies for crossposting!
Posted on 9/17/13 3:58 PM in reply to Mika Koivisto.
Mika,

I apologize in advance for cross-posting, but I wanted to ask an urgent question about this:

Original link here:
https://www.liferay.com/web/armin.dahncke/blog/-/blogs/setting-up-liferay-p­ortal-6-1-ee-as-a-sp

We have a client who needs to implement Liferay as an SP for BOTH user login *and application login. We are already implementing SAML plugin for user login.

The Application login will be Liferay(SP) logging in to the IDP as an application user, not as a specific user so we need both. Does the SAML plugin have any support for this out of the box?

If not, would we need a BOTH a SAML metadata IDP XML for the user login *AND another SAML metadata IDP XML for the application login?

Is this completely out of the use case of SAML to do an application login? Please tell me we are not the first ones to be asked to use SAML to do this?

Thanks in advance.
Posted on 9/18/13 8:48 AM in reply to Mika Koivisto.
Well it depends what you mean by application login. We don't support ECP profile yet which is something you'd need for example to do SAML based authentication to WSRP. You could use JAAS with SAML but that depends on your use case whether that works or not.
Posted on 9/18/13 11:44 AM in reply to Clint Wilde.
Thanks Mika. I just received more clarification. Does the SAML portlet support doing an AttributeQuery and getting a specific attribute from the IDP?

Thanks
Posted on 9/18/13 12:07 PM in reply to Mika Koivisto.
AttributeQuery is not supported at this point. You can include attributes in the Response only.
Posted on 9/18/13 12:11 PM in reply to Clint Wilde.
ughh... Thanks. General question to gage difficulty: can you give me a rough estimate on how long you would expect a good java java developer (with no knowledge of this plugin and limited knowledge of SAML) to get in and make those changes to support AttributeQuery and are there any external roadblocks that would prevent us from adding that? Again, I appreciate your help.
Posted on 9/18/13 12:23 PM in reply to Mika Koivisto.
I took a quick look at the spec to refresh my memory on AttributeQuery and it seems that implementing just that part shouldn't be all that difficult. I'd say that a week should be more than enough for someone that knows SAML. I don't see any roadblocks from adding it and the plugin is fairly extendable. If you don't mind sharing more details on your use case I'd be interested in hearing. You can do that privately by emailing me directly. My email is firstname.lastname at liferay.com
Posted on 9/18/13 2:48 PM in reply to Clint Wilde.
Thanks Mika. I may take you up on that when we get closer to implementation.

We have another issue related to setting up an IDP:

18:25:44,140 DEBUG [http-bio-8080-exec-14][BaseSAMLMessageDecoder:46] Intended message destination endpoint: https://idp.sample.org/c/portal/saml/sso
18:25:44,141 DEBUG [http-bio-8080-exec-14][BaseSAMLMessageDecoder:46] Actual message receiver endpoint: http://idp.sample.org/c/portal/saml/sso

Both SP and IDP are Liferay. When both servers were only listening on HTTP, the connection worked fine, but we just enabled https on the servers and now we are getting this error. We did set saml.require.ssl=true, but we are still seeing the same error. What do we need to do to get past this error?

Thanks in advance.
Posted on 9/25/13 12:39 PM in reply to Mika Koivisto.
Hi Mika,

We are also getting this Exception in the logs of the IDP. They don't appear to be related:

Caused by: org.opensaml.ws.message.decoder.MessageDecodingException: No SAMLRequest or SAMLResponse query path parameter, invalid SAML 2 HTTP Redirect message
at org.opensaml.saml2.binding.decoding.HTTPRedirectDeflateDecoder.doDecode(HTTPRedi­rectDeflateDecoder.java:98)
at org.opensaml.ws.message.decoder.BaseMessageDecoder.decode(BaseMessageDecoder.jav­a:79)
at org.opensaml.saml2.binding.decoding.BaseSAML2MessageDecoder.decode(BaseSAML2Mess­ageDecoder.java:70)
at com.liferay.saml.profile.BaseProfile.decodeSamlMessage(BaseProfile.java:73)
at com.liferay.saml.profile.WebSsoProfileImpl.decodeAuthnRequest(WebSsoProfileImpl.­java:284)
at com.liferay.saml.profile.WebSsoProfileImpl.doProcessAuthnRequest(WebSsoProfileIm­pl.java:309)
at com.liferay.saml.profile.WebSsoProfileImpl.processAuthnRequest(WebSsoProfileImpl­.java:119)

Do you have any idea what is causing this? Any tips would be very appreciated!

Thank you!
Posted on 9/25/13 12:46 PM in reply to Clint Wilde.
Make sure you are consuming the metadata from https url otherwise it will generate the urls with http.
Posted on 9/26/13 2:35 PM in reply to Clint Wilde.
This could be caused by someone accessing /c/portal/saml/sso or /c/portal/saml/acs without correct parameters.
Posted on 9/26/13 2:37 PM in reply to Clint Wilde.
Hi Mika,
I am following up your conversation with Clint Wilde. We work in the same team. Now we are getting the response back from IDP, I can see NameID in SAML reponse.

<NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">YjY3ODliOGUtNGUwMy0­0MGIwLWEyYmYtZWE5MTk1OTUzYWE1JjNCRTk4MzIwLTA0RkEtNDQ1Ny04MTBFLTgwQkM0MTlGNUE4NA=­=</NameID>

But still getting this exception on our side (we are SP):

00:01:52,509 ERROR [http-bio-8080-exec-30][status_jsp:665] com.liferay.saml.SamlException: Name ID not present in subject
com.liferay.saml.SamlException: Name ID not present in subject
at com.liferay.saml.profile.WebSsoProfileImpl.doProcessResponse(WebSsoProfileImpl.j­ava:486)

Your insight would be much appreciated. Thanks in advance.
Posted on 9/29/13 12:54 PM in reply to Mika Koivisto.
First of all Liferay doesn't support transient NameID. Secondly the SubjectConfirmationMethod has to be urn:oasis:names:tc:SAML:2.0:cm:bearer in order for the subject to be accepted.
Posted on 9/30/13 11:30 AM in reply to Ajit Gauli.
Hi Mika,

I am trying to set up liferay integration with SAML setup, we have here EE edition and I have received liferay SAML bundle for deployment.
I have performed above step you mentioned configuring liferay as IDP, after performing configuration step 1 and 2, when I try to deploy the package. I receive below error in log

17:58:35,251 ERROR [pool-2-thread-2][HotDeployImpl:191] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for saml-portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering servlet context listeners for saml-portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployExcepti­on(BaseHotDeployListener.java:46)
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDepl­oy(ServletContextListenerHotDeployListener.java:37)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java­:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:9­6)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil­.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginCo­ntextListener.java:167)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginConte­xtListener.java:151)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycl­e.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.­java:64)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.­java:56)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BaseP­ortalLifecycle.java:52)
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(Plugi­nContextListener.java:106)
at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized­(SecurePluginContextListener.java:145)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779­)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273­)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)­
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­86)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: com.liferay.portal.kernel.servlet.SecurePluginContextListener cannot be cast to com.liferay.portal.kernel.servlet.SecurePluginContextListener
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.doInvokeDe­ploy(ServletContextListenerHotDeployListener.java:62)
at com.liferay.portal.deploy.hot.ServletContextListenerHotDeployListener.invokeDepl­oy(ServletContextListenerHotDeployListener.java:34)
... 25 more


and when I try to access http://localhost:8080/c/portal/saml/metadata. It throw null pointer exception

19:43:46,895 ERROR [http-bio-8080-exec-7][status_jsp:665] org.opensaml.saml2.metadata.provider.MetadataProviderException: java.lang.NullPointerException
org.opensaml.saml2.metadata.provider.MetadataProvi­derException: java.lang.NullPointerException
at com.liferay.saml.metadata.MetadataManagerImpl.getEntityDescriptor(MetadataManage­rImpl.java:121)
at com.liferay.saml.metadata.MetadataManagerUtil.getEntityDescriptor(MetadataManage­rUtil.java:48)
at com.liferay.saml.hook.action.MetadataAction.doExecute(MetadataAction.java:64)
at com.liferay.saml.hook.action.MetadataAction.execute(MetadataAction.java:46)
at com.liferay.portal.kernel.struts.BaseStrutsAction.execute(BaseStrutsAction.java:­37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav­a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHand­ler.java:67)
at $Proxy548.execute(Unknown Source)
at com.liferay.portal.struts.ActionAdapter.execute(ActionAdapter.java:50)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.­java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.­java:176)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt­erChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.­java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.j­ava:335)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java­:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilte­r.java:294)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPos­tFilter.java:83)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.ja­va:80)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(V­irtualHostFilter.java:216)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDire­ctCallFilter(InvokerFilterChain.java:187)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.jav­a:738)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFi­lter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDire­ctCallFilter(InvokerFilterChain.java:167)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDire­ctCallFilter(InvokerFilterChain.java:167)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDire­ctCallFilter(InvokerFilterChain.java:187)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(In­vokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(Invoker­Filter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt­erChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.­java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2­25)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1­69)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav­a:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118­)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor­.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractPro­tocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)­
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:8­86)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.liferay.saml.util.OpenSamlUtil.buildEntityDescriptor(OpenSamlUtil.java:246)
at com.liferay.saml.metadata.MetadataGeneratorUtil.buildIdpEntityDescriptor(Metadat­aGeneratorUtil.java:48)
at com.liferay.saml.metadata.MetadataManagerImpl.getEntityDescriptor(MetadataManage­rImpl.java:107)
... 91 more

I appreciate if you can help me to get through this or point to appropriate official guide to follow.

Thanks
V
Posted on 10/14/13 12:45 PM.
Hi Mika,
Can you explain the saml.metadata.paths property.
We are setting up liferay as SP and external pf as IdP. Questions that i have are
1. Is saml.metadata.paths required when setting liferay as SP?
2. Can IdP metadata be consumed from the SAML assertion itself?
3. Can IdP metadata be only updated via a file to liferay?

Appreciate your attention and reply to this or can you point to me to detailed documentation on SAML properties ?

Thanks
Posted on 10/21/13 2:43 PM.
Pls ignore the previous question, Not what I intended to ask. Is there a way to delete questions from here by users posted by them?
Posted on 10/23/13 4:36 AM in reply to Ash Gupta.
Hi Mika,
I would still like to know all the saml related properties in one place, is it available someplace ?
Posted on 10/23/13 4:41 AM in reply to Ash Gupta.
Our documentation team is still working on the SAML portlet documentation. All the properties you need are described in the few blog posts there are about SAML. Once we release the new version you won't need any properties because everything will be configured from the control panel.
Posted on 10/23/13 11:00 AM in reply to Ash Gupta.
Hi Mika,
Thanks, I think I got most of the properties. I havea separate question since I seem to be hitting https://support.liferay.com/browse/LPS-25238 on a different installation trying to setup a Liferay as SP.

Is it important to use the same keystore generated for Liferay saml for the ssl configuration of Tomcat or can these be different ?
Posted on 10/24/13 11:21 AM in reply to Mika Koivisto.
The keystore for SSL can and probably should be different from SAML keystore.
Posted on 10/24/13 11:29 AM in reply to Ash Gupta.
HI Mika,
Thanks!
One other question that I don't seem to get definitive answer on. Can you confirm if the plugin supports encrytped SAML assertion (saml:EncryptedAssertion) in addition to being signed ?
Posted on 10/24/13 5:36 PM in reply to Mika Koivisto.
Encrypted assertions are in the roadmap but not currently supported.
Posted on 10/24/13 6:39 PM in reply to Ash Gupta.
Hi Folks, the issue I was facing with "Error registering servlet context listeners for saml-portlet" was resolved with Hotflix provided by liferay. Although its not available for community edition. only for EE
Posted on 10/31/13 1:44 PM.
Hi Mika,
Thanks for the confirmation on encryptedAssertion.
I am now wondering if encrypted attribute values, not the whole assertion is supported or not. Can you please confirm that?
If encrypted values are supported, how do you configure the keys/certificates to decrypt the values?
Posted on 11/5/13 8:42 AM in reply to Mika Koivisto.
Vaibhav

Can you tell me what patch it was, we are having the same issue.

Thanks in advance!
Brett
Posted on 11/8/13 4:30 PM in reply to vaibhav kachare.
Brett,
Patch that we receive was liferay-hotfix-1552-6120, if you have EE licence you should be able to issue ticket to liferay support.

Regards
Vaibhav
Posted on 11/12/13 10:59 AM in reply to Brett Lewinski.
thank you,very good article
Posted on 2/11/14 10:19 PM.
Hi Mika,

I've setup the saml plugin as idp and it works fine. I'm able to access the metadata through https://myhost/portail/c/portal/saml/metadata .
Notice portail is my portal context.

However in the metadata , I can see that the bindings are in http and the portal context (root) is missing .

<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://myhost/c/portal/saml/sso"/>

Am I missing a patch or is this a bug ?

Thanks.
Posted on 2/18/14 1:55 PM.
I'm pretty sure that is fixed but I don't remember the ticket number. If it is fixed it'll be in the latest version of the plugin.
Posted on 2/18/14 2:06 PM in reply to Thierry Dagnino.
I'm using the version 1.0 for liferay 6.1.2 ga 2 EE . I'll try the 1.0.1.
Thanks
Posted on 2/18/14 2:14 PM in reply to Mika Koivisto.
Hi ,

I installed the 1.0.1 version and still have the problem with the paths in the bindings.
Any ideas ?

Thanks.
Posted on 2/18/14 3:10 PM in reply to Thierry Dagnino.
Have you set portal.ctx property to your portal context path in portal-ext.properties?
Posted on 2/25/14 3:23 PM in reply to Thierry Dagnino.
I dug deeper and looks like there is really a problem. I've created https://issues.liferay.com/browse/LPS-44619 and will soon fix it.
Posted on 2/26/14 11:41 AM in reply to Mika Koivisto.
Hi Mika,

I had opened a ticket with liferay support and there is a request for change with the engeneering team. I don't know if its you that will pick it up.

It is Brian Suh who has escalated the issue if you want to contact him.

Thanks.
Posted on 2/26/14 11:48 AM in reply to Mika Koivisto.
[...] If you are not familiar with SAML, check out awesome blog by Mika Koivisto. [...] Read More
Posted on 4/11/14 5:44 AM.
As you state in the blog, Salesforce does not support the single logout profile.
When I logout from the portal , liferay tries to do a logout at salesforce.com . The logout at salesforce fails and a page is displayed from the portal saying "All service providers are processed. Continuing sign out automatically in 5 seconds" and giving a link to retry the logout at salesforce.
Is there a way to not display this page since we know that salesforce.com will never process the logout request ?
In other words, is there a way to tell liferay that single logout is not supported by a SP ?
Thanks
Posted on 4/25/14 7:21 AM.
I see this same issue in the environment I am setting up. In my case, I simply don't want a logout in portal to log user off of remote app. But it does seem to try, even though the Metadata from the SP does not have a /SLO endpoint. I have configured the SP to only support Local Logout. So the request from portal to try to log out is very fast, but it still indicates a failure, and nothing is captured in the logs.
Posted on 5/9/14 7:14 AM in reply to Thierry Dagnino.
[...] Getting started with Liferay SAML 2.0 Identity Provider - Blog Liferay 6.1 EE comes with SAML 2.0 Identity Provider and Service Provider support via SAML plugin. If you are not familiar with SAML... [...] Read More
Posted on 5/21/14 2:34 AM.
Hi MIka, Is there a multiple idp support in the current saml release for liferay 6.2?
Posted on 6/9/14 4:47 PM in reply to Mika Koivisto.
Has it worked for you, i am getting the following errors " Unable to process SAML request "when i try to access the URL http://localhost:8080/c/portal/saml/metadata, in the logs the error is "Credential is Required"
Posted on 7/8/14 11:22 PM in reply to Imad T..
Hi Mika,
thanks for your post.
i am able to use the single sign on functionality with salesforce with the admin user test@liferay.com
but whenever i try to sign in with another user(imported from LDAP) this functionality is not working i am getting error "your login attempt with single sign on account have failed,please contact your salesforce administrator"
Posted on 9/16/14 5:22 AM in reply to Mika Koivisto.
Hi,

One more question i want to ask is the user which is getting authenticated using liferay sign up this particular user have to be registered on saleforce.com
means my use case is
we have a liferay integrated with LDAP and we would like SSO LDAP users in salesforce.com without registering those users in salesforce.com
we just want to create authentication certificate for salesforce.com
how can we achieve above functionality.
thanks
kapil
Posted on 9/17/14 5:05 AM in reply to Mika Koivisto.
You'd need to provision the users from your LDAP to Salesforce or to configure Salesforce to automatically create users from attributes provided in SAML Assertion.
Posted on 9/17/14 5:12 AM in reply to Kapil Burange.
is this the only way to register ldap user in sales force or can we generate the keystore with ldap group which contains all the users and register that certificate in salesforce....
Posted on 9/17/14 5:19 AM in reply to Mika Koivisto.
we cannot allow LDAP connectivity to Salesforce and would like to use SAML assertion for creating users. How to do that?
and one thing we want to add some custom fields from LDAP to be inserted in the SAML how can we do that.
please suggest
thanks
Kapil
Posted on 9/17/14 5:34 AM in reply to Mika Koivisto.
Hi Mika,
thanks for the reply.
i just want to ask that on salesforce end how can we check the field firstname lastname email uuid and screenname and on liferay end we have configured
saml.idp.metadata.attribute.names[https://saml.salesforce.com]=screenName,firstN­ame,lastName,emailAddress,uuid this property
please reply because i am kind of stuck on this.
Posted on 9/24/14 7:04 AM in reply to Mika Koivisto.
Hi Mika,

Your "Getting started with Liferay SAML 2.0 Identity Provider" document is very clear and well written. I was able to follow the procedures and successfully setup the SAML integration between Liferay and Salesforce.

However, for another scenario whereby there are more than 1 Salesforce custom domains e.g. customers and partners domains, I presume the 2 domains are considered as different service providers.

What would be the configuration required to support multiple service providers in this case?

Thanks.

Regards.
Posted on 10/2/14 3:41 AM.
Hi Mika,

Is the encryption assertion is available now. I am using liferay 6.2 EE latest version.
and if it is available please let us know how to achieve it...
or what properties we should use..
Please reply.......emoticon
Posted on 11/5/14 5:42 AM in reply to Mika Koivisto.
It's not available yet.
Posted on 11/5/14 7:34 AM in reply to Kapil Burange.
Thank you so much for quick response......emoticonemoticon
It seems that saml 2.0 has attribute encryptions as we can able to see following attributes in saml response
<dsemoticonigestMethod Algorithm="............/"> for xmldsign#sha1
<ds:SignatureMethod Algorithm="............/"> for xmldsign#sha1
please confirm and if possible please explain these attributes.....
Thanks In Advance emoticon
Really appreciate your response.....emoticon
Posted on 11/6/14 2:01 AM in reply to Mika Koivisto.
Hi Mika,
This is a good starter for this useful tool. It would also be helpful to have a full listing of the SAML2 specific properties that can be used. In my case I need something to allow the use of the web.server.protocol property to be used independently from the SAML settings. I've outlined the issue in a separate thread ...

https://www.liferay.com/community/forums/-/message_boards/message/45352086
Posted on 11/14/14 7:57 AM.
Hi Mika,

can you please tell how to pass RelayState in the link
my relay state value will be(tc=E1001)
/c/portal/saml/sso?entityId=https://saml.salesforce.com&RelayState=t­c=E1001

Regards
Kapil
Posted on 11/20/14 3:58 AM in reply to Mika Koivisto.
Did u get this error resolved? If so plz advise.
Posted on 12/4/14 1:09 PM in reply to Clint Wilde.