You need to sign in to do that
Don't have an account?
Marcel dos Santos
Log into Salesforce Communities from External Application
I have a web application where users log in using their login an password.
I'm creating a Salesforce Community for those users, for them to ask questions, read articles, start discussions, etc.
I have a scheduled process now that synchronizes the users I have in my application to Salesforce. I'm extending that process to create contacts and community users, so my users won't have to manually register into the community.
In the next step, I'm going to add a link to my application where the users can click and be logged into the community, in a new window. As the users are already logged into my application, I don't whan them to provide their login again to communities. How can I achieve that?
I read a lot of Salesforce documentation on loggin in using SAML and OAuth and couldn't find anything that suits my needs. OAuth is all about authenticating the user and giving me an access token, so my application can perform actions in the community on the behalf of my user. I don't want that. I only want to login the user.
A solution could be use SAML to single sign on, but then I would need to manage my user in a SSO provider and I don't want to do that. Is there any way to log my user into the communities using only its email or Salesforce Id, without requiring them to provide credentials? Can I provide some secret or key from my application and log in any user I want?
I found something close to that with OAuth 2.0 JWT Bearer Token Flow, but even then I would need a user first authentication to get an authorization token.
Thank you
I'm creating a Salesforce Community for those users, for them to ask questions, read articles, start discussions, etc.
I have a scheduled process now that synchronizes the users I have in my application to Salesforce. I'm extending that process to create contacts and community users, so my users won't have to manually register into the community.
In the next step, I'm going to add a link to my application where the users can click and be logged into the community, in a new window. As the users are already logged into my application, I don't whan them to provide their login again to communities. How can I achieve that?
I read a lot of Salesforce documentation on loggin in using SAML and OAuth and couldn't find anything that suits my needs. OAuth is all about authenticating the user and giving me an access token, so my application can perform actions in the community on the behalf of my user. I don't want that. I only want to login the user.
A solution could be use SAML to single sign on, but then I would need to manage my user in a SSO provider and I don't want to do that. Is there any way to log my user into the communities using only its email or Salesforce Id, without requiring them to provide credentials? Can I provide some secret or key from my application and log in any user I want?
I found something close to that with OAuth 2.0 JWT Bearer Token Flow, but even then I would need a user first authentication to get an authorization token.
Thank you
So, you will need to implement SSO via either SAML or OpenID Connect (http://openid.net/connect/) (see also this article (https://developer.salesforce.com/page/Inside_OpenID_Connect_on_Force.com)). The latter is probably more straightforward if you're wanting to build something yourself or use an open source library (http://openid.net/developers/libraries/#connect). Once you have enabled your web application as an OpenID Connect identity provider (effectively the equivalent of Google), you would configure an Authentication Provider (https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_openid_connect.htm&language=en_US%22) in your community with the OpenID Connect URLs.
An alternative would be to flip the whole system around and have users login to the Salesforce Community, making it the OpenID Connect provider and your web application the OpenID Connect consumer.
All Answers
So, you will need to implement SSO via either SAML or OpenID Connect (http://openid.net/connect/) (see also this article (https://developer.salesforce.com/page/Inside_OpenID_Connect_on_Force.com)). The latter is probably more straightforward if you're wanting to build something yourself or use an open source library (http://openid.net/developers/libraries/#connect). Once you have enabled your web application as an OpenID Connect identity provider (effectively the equivalent of Google), you would configure an Authentication Provider (https://help.salesforce.com/HTViewHelpDoc?id=sso_provider_openid_connect.htm&language=en_US%22) in your community with the OpenID Connect URLs.
An alternative would be to flip the whole system around and have users login to the Salesforce Community, making it the OpenID Connect provider and your web application the OpenID Connect consumer.
In case anyone have the same problem, the solution I adopted was to set my application as the Identity Provider.
I've created a SSO configuration in Salesforce with login and logout URLs pointing to my application and provide a SAML response to Salesforce with the user identity. The response is signed and the public key is informed in the SSO configuration.
I went through the related technical documents but still not clear how to implement this.
Could you give some detailed descriptions on how to send the SAML response to Salesforce? Define a text field with the content of SAML in a form or some other ways? And I also have no idea how to generate the content of the XML, by manual or use some utilities? How to sign the response and the public you used is the one generated in salesforce, right?
Thanks in advance.
I have the same scenario as Marcel's. I'm not clear how to enable our web application as an OpenID Connect identity provider.
Thanks.
I actually didn't use any framework to generate the SAML response to Salesforce. What I did was get the description from SAML 2.0 from Wikipedia and edit it with my company information.
Once you generate the XML, you can validate it in Salesforce on Security Controls > Single Sign-On Settings > SAML Assertion Validator.
I didn't used OpenId and used Java XML encryption to sign the XML assertion: https://docs.oracle.com/javase/7/docs/technotes/guides/security/xmldsig/XMLDigitalSignature.html.
Here is an example of a SAML Assertion I used to log into a community:
If you need to test your SAML Assertions or view other examples, this site has very useful tools:
https://www.onelogin.com
Thanks for taking the time to respond. Much appreciated.
It helps me a lot. I do find some cool stuffs from onelogin.
Thank you so much, buddy!
You described exactly what I am trying to achieve. Another developer is taking care of the SAML response from the external application. I am trying to figure out what I need to do on the Salesforce end and where do I even start (I am a complete newbie for SSO). Would you be able to break down the steps required for the whole process? That would be incredibly helpful!
Thanks in advance!