<?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>MQX Software Solutions中的主题 Re: HTTP Server Authentication</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160647#M1199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am new on MQX and RTCS and I would like to use the Authentification code, but i don't understand or and how integrate him into my code !&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I change and recompile RTCS as JonSmith describes it, but&amp;nbsp;I am stopped by:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Add to my project authentification callback function like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int _http_auth_internal (HTTPD_SESSION_STRUCT* session){  // check user login  if (strncmp(session-&amp;gt;request.auth, your_login, YOUR_LOGIN_SIZE) != 0)    return 1;  // check user password  if (strncmp(session-&amp;gt;request.authPasswd, your_pass, YOUR_PASSWORD_SIZE) != 0)    return 1;  // all good  return 0;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And attach this callback with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTPD_SET_PARAM_AUTH_FN(server, _http_auth_internal);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you an example or more information ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beforehand thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS sorry for my very bad English&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:06:02 GMT</pubDate>
    <dc:creator>cartelectronic</dc:creator>
    <dc:date>2020-10-29T09:06:02Z</dc:date>
    <item>
      <title>HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160641#M1193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't see any basic or digest authentication in the RTCS HTTP server. Have I missed something obvious, or have these features been taken out and are something I need to approach Embedded Access for?&lt;/P&gt;&lt;P&gt;I need to put in some kind of fairly simple password-based security... just wondering what everyone thought the best course of action would be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 18:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160641#M1193</guid>
      <dc:creator>Joe2</dc:creator>
      <dc:date>2010-11-04T18:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160642#M1194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved this issue by follow steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. In file &lt;STRONG&gt;../Freescale MQX 3.5/rtcs/source/httpd/httpd.c&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; go to function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;static void httpd_processreq(HTTPD_STRUCT *server, HTTPD_SESSION_STRUCT *session)&lt;/PRE&gt;&lt;P&gt;find a line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int cgi = 0, res = 0, auth = 0;    // authorization required flag&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and change it to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int cgi = 0, res = 0, auth = 1;    // authorization required flag&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In same file find a function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void httpd_ses_init(HTTPD_STRUCT *server, HTTPD_SESSION_STRUCT *session, const int sock)&lt;/PRE&gt;&lt;P&gt;and insert line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTPD_MEMZERO(session-&amp;gt;request.auth, server-&amp;gt;params-&amp;gt;max_auth);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;before&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#if HTTPDCFG_POLL_MODE        session-&amp;gt;line_used = 0;#endif&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Add to my project authentification callback function like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int _http_auth_internal (HTTPD_SESSION_STRUCT* session){  // check user login  if (strncmp(session-&amp;gt;request.auth, your_login, YOUR_LOGIN_SIZE) != 0)    return 1;  // check user password  if (strncmp(session-&amp;gt;request.authPasswd, your_pass, YOUR_PASSWORD_SIZE) != 0)    return 1;  // all good  return 0;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And attach this callback with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTPD_SET_PARAM_AUTH_FN(server, _http_auth_internal);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's all. Work fine in my project on MQX version 3.5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:06:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160642#M1194</guid>
      <dc:creator>JonSmith</dc:creator>
      <dc:date>2020-10-29T09:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160643#M1195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And of course recompile RTCS after changes from my previous post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 23:15:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160643#M1195</guid>
      <dc:creator>JonSmith</dc:creator>
      <dc:date>2010-11-04T23:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160644#M1196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JonSmith&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's brilliant, thanks! I think that's just saved me a day's coding.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Virtual bottle of wine coming through now...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Nov 2010 17:29:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160644#M1196</guid>
      <dc:creator>Joe2</dc:creator>
      <dc:date>2010-11-05T17:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication logout???</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160645#M1197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, This Authentification code is working fine! So now I would like to know what is the best way to logout the server???&lt;/P&gt;&lt;P&gt;I would like to recall the Authentification windows in the browser if the user try to click on a link after to logout.&lt;BR /&gt;Regis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2011 14:49:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160645#M1197</guid>
      <dc:creator>r_letourneur</dc:creator>
      <dc:date>2011-09-05T14:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160646#M1198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;&lt;P class="lia-message-dates lia-message-post-date lia-component-post-date-last-edited"&gt;&lt;SPAN&gt;&lt;SPAN&gt;2011-09-05&lt;/SPAN&gt; &lt;SPAN&gt;08:49 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="lia-message-body lia-component-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi, This Authentification code is working fine! So now I would like to know what is the best way to logout the server???&lt;/P&gt;&lt;P&gt;I would like to recall the Authentification windows in the browser if the user try to click on a link after to logout.&lt;BR /&gt;Regis.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2011 21:31:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160646#M1198</guid>
      <dc:creator>r_letourneur</dc:creator>
      <dc:date>2011-09-06T21:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160647#M1199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am new on MQX and RTCS and I would like to use the Authentification code, but i don't understand or and how integrate him into my code !&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I change and recompile RTCS as JonSmith describes it, but&amp;nbsp;I am stopped by:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Add to my project authentification callback function like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int _http_auth_internal (HTTPD_SESSION_STRUCT* session){  // check user login  if (strncmp(session-&amp;gt;request.auth, your_login, YOUR_LOGIN_SIZE) != 0)    return 1;  // check user password  if (strncmp(session-&amp;gt;request.authPasswd, your_pass, YOUR_PASSWORD_SIZE) != 0)    return 1;  // all good  return 0;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And attach this callback with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTPD_SET_PARAM_AUTH_FN(server, _http_auth_internal);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you an example or more information ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beforehand thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS sorry for my very bad English&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:06:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160647#M1199</guid>
      <dc:creator>cartelectronic</dc:creator>
      <dc:date>2020-10-29T09:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160648#M1200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I found why it did not work, i use MQX 3.8 !&lt;/P&gt;&lt;P&gt;change:&lt;/P&gt;&lt;PRE&gt;int _http_auth_internal (HTTPD_SESSION_STRUCT* session)&lt;/PRE&gt;&lt;P&gt;to&lt;/P&gt;&lt;PRE&gt;int32 _http_auth_internal (HTTPD_SESSION_STRUCT* session)&lt;/PRE&gt;&lt;P&gt;and i work fine on MQX 3.8&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:06:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160648#M1200</guid>
      <dc:creator>cartelectronic</dc:creator>
      <dc:date>2020-10-29T09:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160649#M1201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!!!&lt;/P&gt;&lt;P&gt;It is my first work on Freescale platform!! I have tried your suggest and it works fine!!!! But... I want something different... :smileyconfused: Is it possible to have the authorization form (pop-up with user and password) showed only when the user goes in a particular page html? &lt;/P&gt;&lt;P&gt;Have you got any idea for implement this feature?&lt;/P&gt;&lt;P&gt;Thank you very much!!!!&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 14:30:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160649#M1201</guid>
      <dc:creator>massimoballerin</dc:creator>
      <dc:date>2013-03-25T14:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP Server Authentication</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160650#M1202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;Solved&lt;/SPAN&gt;&lt;SPAN&gt;! It was easier&amp;nbsp; than I thought...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="hps"&gt;I examine&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the request&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;if&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;it&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;page&lt;/SPAN&gt;&lt;SPAN&gt;, active&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;authorization&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;flag.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; if(strcmp(" request ",session-&amp;gt;request.path) == 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&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; auth=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;:smileywink:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 16:22:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/HTTP-Server-Authentication/m-p/160650#M1202</guid>
      <dc:creator>massimoballerin</dc:creator>
      <dc:date>2013-03-25T16:22:57Z</dc:date>
    </item>
  </channel>
</rss>

