question

jason4335 avatar image
jason4335 asked anton-nikitin commented

Parameter [prompt] value is invalid

I am attempting integrate a program with Authorization Code Flow using cURL; I use Coldfusion, so I have adapted my code based the documentation, but you should be able to understand the URL variables that I am passing:


<cfhttp


method="get"

url="https://platform.devtest.ringcentral.com/restapi/oauth/authorize";

resolveurl="yes"

getasbinary="never"


>


<cfhttpparam type="header" name="content-type" value="application/x-www-form-urlencoded">


<cfhttpparam type="url" name="response_type" value="code">

<cfhttpparam type="url" name="client_id" value="#client_id#">

<cfhttpparam type="url" name="redirect_uri" value="#redirect_uri#">

<cfhttpparam type="url" name="state" value="#state#">

<cfhttpparam type="url" name="prompt" value="login">


</cfhttp>


When I execute the code, it processes and displays code that can only execute if the redirect_uri is executed, therefore, the Ringcentral server is forwarding to the redirect_uri.


Here's what my server finds the following variables on dumping variables off of the redirect_uri page:


error: invalid_request

error_description: Parameter [prompt] value is invalid

state : ydcm2ud3d2edvLde911nvev9zwvhLiLztzkhh4qmyc6beg44se


1) The only variable that is passed to my redirect_uri page is "state"


2) The error does not make sense. The prompt variable value is correct. The documentation says use "login".


I am trying to a response so I can get access token and refresh tokens so I can interact with the API calls.


Please advise....




errors
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

jason4335 avatar image
jason4335 answered jason4335 commented
It's been a week.  I appreciate the help from some of you on this forum, however, Ringcentral's lack of response from the Developer team is disappointing.

I have used this code with Google's API and it works, so I know my authorization flow works with them...


4 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image Tyler Liu ♦ commented ·
Could you please try the process using this SDK?  https://github.com/tylerlong/ringcentral-python#authorization-code-flow-3-legged-authorization-flow  Write some Python code and let's see whether it works. It if does, then we know your account has no problem. Otherwise it's might be your account's issue instead of a programming issue.
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
If you don't want to write code manually. You can try to run any of the demos here:  https://github.com/ringcentral/ringcentral-demos-oauth Choose your favorite language and try to make it work.

We will see if it's a account issue or programming issue.
0 Likes 0 ·
anton-nikitin avatar image anton-nikitin commented ·
Jason, we are not experts in ColdFusion. Your case is pretty unique and I guess that it works with Google because they do not have intermediary redirects. Just curios if removing "resolveurl" parameter helps in your case?

Actually this post refers the same problem as you have:  http://www.codersrevolution.com/blog/CFHTTP-doesnt-resolve-URLs-properly-on-redirect
0 Likes 0 ·
jason4335 avatar image jason4335 commented ·
I tried setting resolveurl to "no" previously and it didn't help, because that was actually the first thing I thought of.  I thought maybe my server is fooling with the mappings.

I completely understand that Coldfusion is not a common code, however, the behavior of what is happening is what I am looking for guidance on...that's not a code thing...that's general error that could affect all people regardless of the code.

I have used CFHTTP for cURL operations for other Auth2.0 situations and I don't have trouble with the authorization window in those situations....it's obviously processing, because it's redirecting me, yet it's escaping your web server.

CFHTTP is simple....it returns exactly what it is returned from the server and here:

<cfoutput>#cfhttp.FileContent#</cfoutput>

It's returning "login/unifiedLogin.html?session=......." without mapping to the full domain, so my server is taking over thinking the folder is there.

It's like your server is returning /login/unifiedLogin.html?...." as opposed to mapping it completely with the full URL, so what does my server do? It say..."oh you must want to map it to  "login/unifiedLogin.html?session=......." which have I have no such mapping.

" https://service.ringcentral.com/login/unifiedLogin.html?......"

So I can confirm it's not something on my end, please confirm this:

1) Is my url correct:  https://platform.devtest.ringcentral.com/restapi/oauth/authorize

2) On processing on your side in the API, when the login window is requested and passed back to me....is the entire URL mapped with " https://service.ringcentral.com/" on your end?  If it isn't, then that will cause problems with some users based on how some servers handle call backs.

Thanks.


0 Likes 0 ·
jason4335 avatar image
jason4335 answered Tyler Liu commented
I will add something else....Tyler's favorite answer to everyone is to point people to your code examples...why not spend a little time and let's get a working CF example for folks...believe me...there are a lot of applications out there that use CF.
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image Tyler Liu ♦ commented ·
I really have no idea of CF. Maybe it's time to learn a new programming language or framwork. LoL.
0 Likes 0 ·
anton-nikitin avatar image
anton-nikitin answered anton-nikitin commented
Jason, regarding your questions:

1) Yes, your URL is correct

2) Here is the call I made and traced for your reference. So you can see that our server returns full URL in the path.

GET https://platform.devtest.ringcentral.com/restapi/oauth/authorize?    client_id=...&redirect_uri=...&response_type=code&state=... HTTP/1.1  Accept-Encoding: gzip,deflate  Host: platform.devtest.ringcentral.com  Connection: Keep-Alive  User-Agent: Apache-HttpClient/4.1.1 (java 1.5)     
HTTP/1.1 302 Found Server: nginx/1.10.2 Date: Mon, 12 Mar 2018 20:02:45 GMT Content-Length: 0 Connection: keep-alive X-Application-Context: application:8080 Location: https://service.devtest.ringcentral.com/mobile/loginDispatcher? responseType=code&clientId=...&brandId=1210&state=...&localeId=en_US& endpointId=&session=-2915783893910517926&display=page& prompt=login%20consent%20sso&scope=& appUrlScheme=...&ui_options=&hideNavigationBar=true
I pointed you earlier to this post: http://www.codersrevolution.com/blog/CFHTTP-doesnt-resolve-URLs-properly-on-redirect. So maybe you need to check with ColdFusion support.
9 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

jason4335 avatar image jason4335 commented ·
Ok....I read that article and it didn't help, but I didn't double-check his work before I tried it...his use of an attribute of CFHTTP was wrong:

redirect="False"

to correct the problem.  That's not right after checking the CF documentation...it's this:

redirect="no"

After doing that, I am getting this:

{ "errorCode" : "AGW-401", "message" : "Authorization header is not specified", "errors" : [ { "errorCode" : "AGW-401", "message" : "Authorization header is not specified" } ] }

At this there is progress....

0 Likes 0 ·
anton-nikitin avatar image anton-nikitin commented ·
Aren't you calling the wrong URL "/restapi/oauth/token" instead of "/restapi/oauth/authorize" in this request?
0 Likes 0 ·
jason4335 avatar image jason4335 commented ·
Ok that is my fault..when I made my other changes, I copied the wrong link.  

Retested...it didn't redirect now and the header returned:

Status Code: 302
RCRequestId: fc121d0e-263d-11e8-8b21-005056bb26b9


Thanks for the continued help.
0 Likes 0 ·
anton-nikitin avatar image anton-nikitin commented ·
So, Jason, do you have any other questions about this issue?
0 Likes 0 ·
jason4335 avatar image jason4335 commented ·
Anton, 

You have been very helpful which I really appreciate.

My page does not redirect after processing and does not return the Authorization Window.

I posted the Status Code and RCRequestId from the header response.

Jason

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys