<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://customerfx.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ryan Farley&amp;#39;s Blog : Integration, SalesLogix Web</title><link>http://customerfx.com/pages/crmdeveloper/archive/tags/Integration/SalesLogix+Web/default.aspx</link><description>Tags: Integration, SalesLogix Web</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Passing Connection Information from SalesLogix Web to Another Website</title><link>http://customerfx.com/pages/crmdeveloper/2011/12/22/passing-connection-information-from-saleslogix-web-to-another-website.aspx</link><pubDate>Thu, 22 Dec 2011 17:44:00 GMT</pubDate><guid isPermaLink="false">e15581aa-2787-4c59-a940-524c09f5d256:45386</guid><dc:creator>Ryan Farley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/crmdeveloper/rsscomments.aspx?PostID=45386</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/crmdeveloper/commentapi.aspx?PostID=45386</wfw:comment><comments>http://customerfx.com/pages/crmdeveloper/2011/12/22/passing-connection-information-from-saleslogix-web-to-another-website.aspx#comments</comments><description>&lt;p&gt;When integrating another system, application, or website with SalesLogix there are many options. If you&amp;#39;re need to make connections to the SalesLogix database via the provider using user credentials you either need to prompt the user for login (again) or you can pass the connection information along to the other system.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s easy enough to get the connection information using the DataService in SalesLogix. However, you don&amp;#39;t really want to pass around a complete connection string around, especially since it will have the user&amp;#39;s username and password in it. However, you can get the user&amp;#39;s authentication token and then pass that to another system. It can use that authentication token to get all the connection values and form a valid connection string. Let&amp;#39;s take a look.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;font size="4"&gt;Retrieving the current user&amp;#39;s Authentication Token&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To retrieve the user&amp;#39;s authentication token, you can use the AuthenticationProvider service. &lt;/p&gt;
&lt;table style="TABLE-LAYOUT:fixed;WIDTH:600px;" cellspacing="0" cellpadding="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;&lt;span style="COLOR:blue;"&gt;var&lt;/span&gt; authService &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; ApplicationContext.Current.Services.Get&amp;lt;IAuthenticationProvider&amp;gt;();
&lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; authToken &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; authService.AuthenticationToken;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;The authentication token will look like a long string of letters and numbers. You can pass this to some other website so that website/webpage can log into SalesLogix as that same user without prompting the user for their username and password. Let&amp;#39;s look at what to do with this authentication token.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;font size="4"&gt;Decrypting and Using the Authentication Token&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Once the other website or webpage has the Authentication Token all you need to do is convert it back&amp;nbsp;to a stream and then read out the values from it. Then you have everything you need to form a valid connection string to the SalesLogix database as the user whose authentication token you have.&lt;/p&gt;
&lt;table style="TABLE-LAYOUT:fixed;WIDTH:600px;" cellspacing="0" cellpadding="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;&lt;span style="COLOR:green;"&gt;// In this code the &amp;quot;authToken&amp;quot; variable holds the authentication token value
// passed from SalesLogix Web (see code above)
&lt;/span&gt;
&lt;span style="COLOR:blue;"&gt;using&lt;/span&gt; (&lt;span style="COLOR:blue;"&gt;var&lt;/span&gt; stream &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; MemoryStream(Convert.FromBase64String(authToken)))
{
    &lt;span style="COLOR:blue;"&gt;using&lt;/span&gt; (&lt;span style="COLOR:blue;"&gt;var&lt;/span&gt; reader &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;new&lt;/span&gt; StreamReader(stream))
    {
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; UserName &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; Password &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; UserId &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; Database &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; Alias &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; Server &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; ExtendedProperties &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; Provider &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();
        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; UserType &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; reader.ReadLine();

        &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; ConnectionString &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt;.Format(
                &lt;span&gt;&amp;quot;Provider={5};Persist Security Info=True;Initial Catalog={1};Data Source={0};User ID={3};Password=\&amp;quot;{4}\&amp;quot;;Extended Properties=\&amp;quot;{2}\&amp;quot;&amp;quot;&lt;/span&gt;, 
                Server, Database, ExtendedProperties, UserName, Password, Provider
            );
    }
}&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;Pretty easy and the other external website or password didn&amp;#39;t need to ask the user again for credentials or store a connection string locally.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;font size="4"&gt;Note if passing the&amp;nbsp;Auth&amp;nbsp;Token in a URL&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are passing this authorization token from SalesLogix to another website or webpage via a parameter in the URL, you &lt;strong&gt;must&lt;/strong&gt; encode the token otherwise any contained &amp;quot;+&amp;quot; chars will break the string (since that will be interpreted in the URL as a space).&lt;/p&gt;
&lt;p&gt;On the SalesLogix side, encode the token using something like this:&lt;/p&gt;
&lt;table style="TABLE-LAYOUT:fixed;WIDTH:600px;" cellspacing="0" cellpadding="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;authToken &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; System.Web.HttpUtility.&lt;strong&gt;UrlEncode&lt;/strong&gt;(authToken);&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;Then, on the receiving side, grab the token from the URL and then decode is using something like this:&lt;/p&gt;
&lt;table style="TABLE-LAYOUT:fixed;WIDTH:600px;" cellspacing="0" cellpadding="0"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;authToken &lt;span style="COLOR:navy;"&gt;=&lt;/span&gt; System.Web.HttpUtility.&lt;strong&gt;UrlDecode&lt;/strong&gt;(authToken);&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;Then all will work fine and you can proceed to get the connection values from the token.&lt;/p&gt;&lt;img src="http://customerfx.com/aggbug.aspx?PostID=45386" width="1" height="1"&gt;</description><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/Development/default.aspx">Development</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/SalesLogix+Web/default.aspx">SalesLogix Web</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/Integration/default.aspx">Integration</category></item><item><title>Integrating the SalesLogix Lead Capture Portal with an Existing Website</title><link>http://customerfx.com/pages/crmdeveloper/2008/06/10/integrating-the-saleslogix-lead-capture-portal-with-an-existing-website.aspx</link><pubDate>Tue, 10 Jun 2008 21:35:00 GMT</pubDate><guid isPermaLink="false">e15581aa-2787-4c59-a940-524c09f5d256:39433</guid><dc:creator>Ryan Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/crmdeveloper/rsscomments.aspx?PostID=39433</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/crmdeveloper/commentapi.aspx?PostID=39433</wfw:comment><comments>http://customerfx.com/pages/crmdeveloper/2008/06/10/integrating-the-saleslogix-lead-capture-portal-with-an-existing-website.aspx#comments</comments><description>&lt;p&gt;It&amp;#39;s much easier than many might think to fully integrate the SalesLogix 7.2 Lead Capture portal into an existing website. For a sample of this, I grabbed a free online website template and put it up as a website and &lt;b&gt;&lt;i&gt;within 5 minutes&lt;/i&gt;&lt;/b&gt; (seriously, 5 minutes) I had the Lead Capture portal fully integrated into the site. Brain-dead easy. Best of all, no frames. &lt;/p&gt;
&lt;p&gt;So, I&amp;#39;ve created a free workshop on June 24th (Tuesday) at 2:00PM Central to cover this topic and demonstrate how to integrate the lead capture portal with an existing website. If you&amp;#39;d like to attend you can register here: &lt;a href="http://customerfx.com/pages/events/2008/06/10/Jun-24_2C00_-2008-_2D00_-Integrating-the-SalesLogix-7.2-Lead-Capture-Portal-with-an-Existing-Website.aspx"&gt;Click to Register&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Join me on the workshop (it&amp;#39;s free) and we can take a look at this together and discuss different scenarios for websites built on different technologies (doesn&amp;#39;t need to be an ASP.NET site).&lt;/p&gt;&lt;p&gt;See you there.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;img src="http://customerfx.com/aggbug.aspx?PostID=39433" width="1" height="1"&gt;</description><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/SalesLogix+Web/default.aspx">SalesLogix Web</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/Integration/default.aspx">Integration</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/Workshop/default.aspx">Workshop</category><category domain="http://customerfx.com/pages/crmdeveloper/archive/tags/Lead+Capture+Portal/default.aspx">Lead Capture Portal</category></item></channel></rss>