<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>28 Mar 2018 15:35:00 Z</lastBuildDate><pubDate>27 Mar 2018 14:44:00 Z</pubDate><description>From the development in Windev I use Oauth 2.0 for authorization to get access to the outlook mail from a user.&#13;
&#13;
The application is registered at https://apps.dev.microsoft.com without the Implicit workflow. After the user enters the credentials, an Authorization Code is returned. With the new code the Bearer Token is requested with a HTTP Post command.&#13;
&#13;
So far, so good.&#13;
&#13;
Only that the response gives an error message that makes no sense to me.&#13;
&#13;
In code:&#13;
&#13;
m_sHTTPUrl = "client_id=" + m_sClientID + "&amp;client_secret=" ...&#13;
+ m_sClientSecret ...&#13;
+ "&amp;redirect_uri=" + m_sRedirectURL + "&amp;code=" + m_sAuthToken ...&#13;
+ "&amp;grant_type=authorization_code"&#13;
m_sHTTPres = ""&#13;
LogLocalFile("GetAccessToken - " + m_sTokenURL + " // " + m_sHTTPUrl)&#13;
&#13;
cMyRequest is httpRequest&#13;
cMyRequest..Method = httpPost&#13;
cMyRequest..URL = m_sTokenURL&#13;
cMyRequest..ContentType = "application/x-www-form-urlencoded"&#13;
cMyRequest..Header["grant_type"] = "authorization_code"&#13;
cMyRequest..Header["code"] = m_sAuthToken&#13;
cMyRequest..Header["client_id"] = m_sClientID&#13;
cMyRequest..Header["client_secret"] = m_sClientSecret&#13;
cMyRequest..Header["scope"] = m_sScope&#13;
cMyRequest..Header["redirect_uri"] = m_sRedirectURL&#13;
//cMyRequest..Content = m_sHTTPUrl&#13;
cMyResponse is httpResponse = HTTPSend(cMyRequest)&#13;
m_sHTTPres = cMyResponse.Content&#13;
In a logfile I requested the used parameters and the content of the httpResponse:&#13;
&#13;
GetAccessToken - https://login.microsoftonline.com/common/oauth2/v2.0/token // grant_type=authorization_code&#13;
&amp;code=xxxxxxx&#13;
&amp;scope=openid+offline_access+User.Read+Email+Mail.Read+Contacts.Read&#13;
&amp;redirect_uri=http://localhost/&#13;
&amp;client_id=xxxxxxx&#13;
&amp;client_secret=xxxxxxx&#13;
&#13;
GetAccessToken - error = invalid_request&#13;
GetAccessToken - error_description = AADSTS90014: The request body must contain the following parameter: 'grant_type'.&#13;
The grant_type is in the header as it is supposed to be.&#13;
&#13;
Does anybody have any clue of what is needed to get the OAUTH2 working ?&#13;
&#13;
With kind regards,&#13;
&#13;
\\Adjan</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following/read.awp</link><title>oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65061/read.awp</comments><pubDate>28 Mar 2018 15:35:00 Z</pubDate><description>Hi Adjan,&#13;
&#13;
Thanks for the complete solution (StringToUTF8), can eventually help me next time.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65061/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65061/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following/read.awp">oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</source><title>Re: oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65060/read.awp</comments><pubDate>28 Mar 2018 13:01:00 Z</pubDate><description>Hello Peter,&#13;
&#13;
Thanx for the direction.&#13;
&#13;
The problem was in the content of the httpRequest. This in WinDev of type Buffer.&#13;
A…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65060/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65060/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following/read.awp">oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</source><title>Re: oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65057/read.awp</comments><pubDate>28 Mar 2018 12:25:00 Z</pubDate><description>Hello Peter,&#13;
&#13;
Thanks for your reply and suggestion to work with.&#13;
&#13;
I tried it, with the same error message.&#13;
I also tried it …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65057/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65057/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following/read.awp">oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</source><title>Re: oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65053/read.awp</comments><pubDate>28 Mar 2018 10:40:00 Z</pubDate><description>Hi Adjan,&#13;
&#13;
Quote&#13;
&#13;
&#13;
GetAccessToken - error_description = AADSTS90014: The request body must contain the following parameter:…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65053/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following-65053/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65041-oauth2-error-aadsts90014-request-body-must-contain-following/read.awp">oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</source><title>Re: oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type'</title></item></channel></rss>
