title: Question on Oauth2 Resource Owner Password Credential Grant in R httr
body: <p>I use Oauth2 authorization to get the token for REST API. I tested the setting in SoapUI and it is working with the Resource Owner Password Credential Grant as shown below.</p>
  <p><a href="https://i.stack.imgur.com/yDW4G.png" rel="nofollow noreferrer">The setting in the SoapUI testing is working</a></p>
  <p>Now, I want to retrieve the token through R httr library, but I don’t know how to set the resource owner name and password in the R code. Here is my Code</p>
  <pre><code>library(httr)
  library(jsonlite)
  
  r &lt;- POST(&quot;https://XXXXXXX.com/authservice/connect/token&quot;,
            config = list(),
            body = list(
              
              # grant_type      = &quot;RESOURCE_OWNER_PASSWORD_CREDENTIALS&quot;,
              grant_type        = &quot;resource_owner_credentials&quot;,
              
              resourceOwnerName         = &quot;ResourceName&quot;,
              resourceOwnerPassword     = &quot;Resourcepwd&quot;,
              
              # resource_Owner_Name     = &quot;ResourceName&quot;,
              # resource_Owner_Password = &quot;Resourcepwd&quot;,
              
              # resourceOwner_Name      = &quot;ResourceName&quot;,
              # resourceOwner_Password  = &quot;Resourcepwd&quot;,
              
              # resource_OwnerName      = &quot;ResourceName&quot;,
              # resource_OwnerPassword  = &quot;Resourcepwd&quot;,
              
              # resource_Name           = &quot;ResourceName&quot;,
              # resource_Password       = &quot;Resourcepwd&quot;,
              
              # resource_id             = &quot;ResourceName&quot;,
              # resource_secret         = &quot;Resourcepwd&quot;,
              
              client_id            = &quot;ClientIDname&quot;,
              client_secret        = &quot;Clientpassword&quot;,
              
              scope                = &quot;xxxGroup&quot;
            ),
            encode = &quot;form&quot;
  )
  warn_for_status(r)
  content(r)
  status_code(r)
  </code></pre>
  <p>I got a 400 error (&quot;unsupported_grant_type&quot; and bad request). I am guessing there may be something wrong with the syntax on the resource onwer name and password, so I also tried all the possible combinations that I commented in above code but they all failed.</p>
  <p>My question is: are the parameter names for both resource owner name and password pre-defined by the API document, or they are the fixed names defined by R-httr librabry, regardless what token authorization service?</p>
  <p>Can someone help to take a look at? Any input is greatly appreciate!</p>