• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Posting Oauth token to log into application

New Here ,
Dec 17, 2016 Dec 17, 2016

Copy link to clipboard

Copied

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?

Views

152

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation