<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to connect to API with windows authentification  / NTLM / LDAP ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275602#M53479</link>
    <description>&lt;P&gt;Form based is one option.&lt;/P&gt;
&lt;P&gt;Basic is another.&lt;/P&gt;
&lt;P&gt;In a nutshell (examples to follow), form based is sending key/value pairs to your webservice much like logging in with a webpage form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basic authentication is in found in the header (HTTP Request &amp;lt;&amp;lt; Headers option), where the authenitcation is&lt;/P&gt;
&lt;P&gt;username:password (Base 64 encodeed). You can also use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;request &amp;lt;&amp;lt; Username("my username");&lt;/P&gt;
&lt;P&gt;request &amp;lt;&amp;lt; Password("my password");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead of setting the header information directly for Basic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'd want both, if possible to be over https.&lt;/P&gt;
&lt;P&gt;Typically, your webservice would set a cookie to manage subsequent requests.&lt;/P&gt;
&lt;P&gt;If you use Basic, then it wouldn't be required as long as you set the header information with each request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you go the Passport option for the webservice, Passport acts a a mediator, it can digest form and Basic(and others) and do the back-end authorization that you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most webservices, like Office 365, Google, Spotify, JMP Live use OAuth2 (not form-based or Basic), but that's due to external visibility of the sites (which add complexity). If it's an in-house behind your firewall, etc, basic or form-based using https is your simplest option, in my opinion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 12:47:44 GMT</pubDate>
    <dc:creator>bryan_boone</dc:creator>
    <dc:date>2020-07-01T12:47:44Z</dc:date>
    <item>
      <title>How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274253#M53224</link>
      <description>&lt;P&gt;Hello jmp users,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to connect to our internal services / api in JMP/JSL (JMP14) with HTTP request method&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;url = "http://192.168.1.1/api/getsomedata;
request = New HTTP Request(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; URL( url ),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method( "Post" ),
Form(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fields([[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "maxLimit" =&amp;gt; "100"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )
);
json = request &amp;lt;&amp;lt; Send();
jsl_json = Parse JSON( json );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The URL needs Windows Authentificaion (Ldap, NTLM).&lt;/P&gt;
&lt;P&gt;Does somebody know a way, how to provide [username, password]&amp;nbsp; windows credentials&amp;nbsp; to access that ressource via&amp;nbsp; HTTP Request&amp;nbsp;Method?&lt;/P&gt;
&lt;P&gt;Related questions are discussed eg here:&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="http Request with authentication using windows identity" uid="63067" url="https://community.jmp.com/t5/Discussions/http-Request-with-authentication-using-windows-identity/m-p/63067#U63067" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Getting Started With REST in JMP" uid="64104" url="https://community.jmp.com/t5/JMP-Add-Ins/Getting-Started-With-REST-in-JMP/m-p/64104#U64104" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Importing Web Service Data: The New HTTP Request in JMP®&amp;nbsp;14 ( US 2018 231 )" uid="73717" url="https://community.jmp.com/t5/Discovery-Summit-2018/Importing-Web-Service-Data-The-New-HTTP-Request-in-JMP-nbsp-14/m-p/73717#U73717" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you diz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 20:37:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274253#M53224</guid>
      <dc:creator>diz</dc:creator>
      <dc:date>2023-06-10T20:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274426#M53229</link>
      <description>&lt;P&gt;HTTP Request doesn't authenticate with NTLM/LDAP directly.&lt;/P&gt;
&lt;P&gt;You'd want to use something like Passport &lt;A href="http://www.passportjs.org/" target="_blank"&gt;http://www.passportjs.org/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;in your webservice, then use form-based authentication or basic authentication&amp;nbsp; over https.&lt;/P&gt;
&lt;P&gt;-Bryan&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 13:17:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274426#M53229</guid>
      <dc:creator>bryan_boone</dc:creator>
      <dc:date>2020-06-19T13:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274968#M53351</link>
      <description>&lt;P&gt;Hi Bryan, thank you for that Information, this is good to know!&lt;/P&gt;&lt;P&gt;Is there an example&amp;nbsp; or code snipplet in the JSL documentation about how to use the form based http Basic authentification with jmp? This i would like to try, before changing something in the server software.&lt;/P&gt;&lt;P&gt;thanks again diz&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 12:40:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/274968#M53351</guid>
      <dc:creator>diz</dc:creator>
      <dc:date>2020-06-23T12:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275068#M53373</link>
      <description>&lt;P&gt;Would Oauth2 be an option? JMP 15 has this in the scripting index.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
/*
https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
*/
				 
/*
Note: the "code" parameter is set automatically after the redirect occurs
*/
auth_url = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
redirect_url = "http://localhost/myapp/";
client_id = "6731de76-14a6-49ae-97bc-6eba6914391e";
client_secret = "JqQX2PNo9bpM0uEihUPzyrh";
scope = "openid offline_access https://graph.microsoft.com/user.read";
auth_fields = [=&amp;gt; ];
token_fields = [=&amp;gt; ];
				 
oauth2 = New OAuth2();
oauth2 &amp;lt;&amp;lt; Grant Type( "Authorization Code" );
oauth2 &amp;lt;&amp;lt; Auth URL( auth_url );
oauth2 &amp;lt;&amp;lt; Token URL( token_url );
oauth2 &amp;lt;&amp;lt; Redirect URL( redirect_url );
				 
auth_fields["scope"] = scope;
auth_fields["client_id"] = client_id;
token_fields["client_secret"] = client_secret;
				 
oauth2 &amp;lt;&amp;lt; Auth Fields( auth_fields );
oauth2 &amp;lt;&amp;lt; Token Fields( token_fields );
				 
auth_header = oauth2 &amp;lt;&amp;lt; Get Auth Header();
request = New HTTP Request(
	URL( "https://graph.microsoft.com/v1.0/me" ),
	Headers( {auth_header} ),
	Method( "GET" )
);
data = request &amp;lt;&amp;lt; Send;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jun 2020 17:19:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275068#M53373</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2020-06-23T17:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275246#M53398</link>
      <description>&lt;P&gt;Hi, thanks for that suggestion! Good, that this option could work, but it is not that what I was looking for originally. Anyway, since there are some workarounds given, I i will mark this discussion as solved! Thanks diz&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 13:55:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275246#M53398</guid>
      <dc:creator>diz</dc:creator>
      <dc:date>2020-06-24T13:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275602#M53479</link>
      <description>&lt;P&gt;Form based is one option.&lt;/P&gt;
&lt;P&gt;Basic is another.&lt;/P&gt;
&lt;P&gt;In a nutshell (examples to follow), form based is sending key/value pairs to your webservice much like logging in with a webpage form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basic authentication is in found in the header (HTTP Request &amp;lt;&amp;lt; Headers option), where the authenitcation is&lt;/P&gt;
&lt;P&gt;username:password (Base 64 encodeed). You can also use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;request &amp;lt;&amp;lt; Username("my username");&lt;/P&gt;
&lt;P&gt;request &amp;lt;&amp;lt; Password("my password");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;instead of setting the header information directly for Basic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'd want both, if possible to be over https.&lt;/P&gt;
&lt;P&gt;Typically, your webservice would set a cookie to manage subsequent requests.&lt;/P&gt;
&lt;P&gt;If you use Basic, then it wouldn't be required as long as you set the header information with each request.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you go the Passport option for the webservice, Passport acts a a mediator, it can digest form and Basic(and others) and do the back-end authorization that you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most webservices, like Office 365, Google, Spotify, JMP Live use OAuth2 (not form-based or Basic), but that's due to external visibility of the sites (which add complexity). If it's an in-house behind your firewall, etc, basic or form-based using https is your simplest option, in my opinion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:47:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/275602#M53479</guid>
      <dc:creator>bryan_boone</dc:creator>
      <dc:date>2020-07-01T12:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/276462#M53639</link>
      <description>&lt;P&gt;Hi Bryan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the update! This solution works&amp;nbsp; and is the real solution! I marked this as solution.&lt;/P&gt;&lt;P&gt;best, diz&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 06:54:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/276462#M53639</guid>
      <dc:creator>diz</dc:creator>
      <dc:date>2020-07-01T06:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect to API with windows authentification  / NTLM / LDAP ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/598295#M80201</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 05:20:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-connect-to-API-with-windows-authentification-NTLM-LDAP/m-p/598295#M80201</guid>
      <dc:creator>UersK</dc:creator>
      <dc:date>2023-02-08T05:20:08Z</dc:date>
    </item>
  </channel>
</rss>

