Highlighted

Posting Oauth token to log into application

New Here ,
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

106

Likes

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

Posting Oauth token to log into application

New Here ,
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

107

Likes

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
Dec 17, 2016 0

Have something to add?

Join the conversation