I am using OAUTH clients. In one of my php page I set a link and set this as href
I set my redirect_uri as http://localhost/kintone.php. When I click on this link, I get an error saying "The redirect_uri parameter is not valid". I also see a code and id values on the same page. What could be the error, can anyone please point it out to me.
No, I was setting the redirect_uri to my localhost. I set the redirect_uri as https://localhost/display_records.php. I want to get the authentication code and then want to get the records from a Kintone app and display on my php page. Here is the scenario.
1. I want to create a php page to have a form, which is accessible to public, once the form is submitted, I want to get the data and put it into kintone app.
2. I want to read from that kintone app and display all the data onto my php page, which should be public.
How to achieve this please?
I am trying to use curl_get() in php as well, but it still complains wrong redirect_uri. Please help.
Here is the error that I see, with code and id values.
Also I noticed that this time when I run the code, it takes me to login screen after I login it fails with this error.
In my Kintone account I created an OAuth client under Integrations. I also set myself as allowed user. When I click on my name in my account settings under Integrations tab, I notice that against this OAuth Client it shows my status as "Inactive". Could that be the reason for it to take me to the login page? How to set it to Active?
Any help on this is greatly appreciated. I also attached my code at the bottom.
//Initialize a CURL session
//From URL to get webpage contents
curl_setopt($ch, CURLOPT_POST, 1);
//grab URL and pass it to the variable
curl_setopt($ch, CURLOPT_URL, $url);
//Execute and get result
$result = curl_exec($ch);
> I notice that against this OAuth Client it shows my status as "Inactive".
This is possibly the reason why you see the error upon logging in.
You should be able to change between active and inactive by clicking on the button
next to the "Set allowed users" for the client.
But I assume that's not possible, I guess?
Can I see how the setting page looks on your side?
It depends on the setting on the OAuth side, so it is difficult to determine the error just by looking at the code at the moment
but, the "http" protocol was specified in redirect_uri.
A URL starting with "http" is specified, but since only "https" can be specified as a redirect endpoint for OAuth authentication.
So, the error might be caused by that.
Also, I do not entirely understand the part,
>When I click on my name in my account settings under Integrations tab, I notice that against this
>OAuth Client it shows my status as "Inactive". Could that be the reason for it to take me to the login page?
>How to set it to Active?
Could you please check the following for us?
・Does the URL specified in the redirect_url match the URL specified in the redirect endpoint of OAuth authentication?
If not, please match it.
・If the OAuth client is not available; please check if it is enabled by clicking on it.
If not, please send the screenshot of the "Inactive" screen to see the current status.
・Please, send us a screenshot of your Add OAuth Client settings screen.
Hopefully, this helps.
Thank you Sean and Yuzo for responding promptly. Actually I found this resource and this worked.
The below given part is not clear in the documentation as to where to put the line of code. I tried to do it with composer but it threw me error. Later I found out after many attempts that this line of code will go into your trial php program file, just above the quick start piece of code. I hope this helps anyone else who is trying to attempt api calls with PHP.
After installing, you need to require Composer's autoloader: