0 Replies Latest reply on Dec 17, 2016 4:35 PM by carolynu42172537

    Posting Oauth token to log into application

    carolynu42172537

      I have code that gets the Oauth token so that I can log into an application.  However, the final part - going to the application - has me stumped.

       

      I have tried a form:

       

      <cfform name="trythis"" id="trythis" method="post" action="http://xxxx/api/v1/users/login.json?token=#gettokennumber#">

      <input type="hidden" name="email" value="user@example.com">

      <input type="hidden" name="password" value="pass123">

      <input type="hidden" name="username" value="user1">

      </cfform>

       

      I am thinking that somewhere I have to use that it uses json...but I'm not sure where

       

      Then I tried cfhttp     But it just sat there, doing nothing...

       

      <cfhttp url="xxxx/api/v1/users/login.json?token=#gettokennumber#" method="post" >

          <cfhttpparam type="header" name="Content-Type" value="application/json" />

          <cfhttpparam name="password" type="formfield" value="pass123">

          <cfhttpparam name="email" type="formfield" value="user@example.com">

      </cfhttp>

       

      What am I doing wrong?