Question

Problem in Facebook Integration with Pega PRPC

Hi,

Could anyone please help in generating authorization token while integrating Pega PRPC with facebook. I have tried with the below given URL but getting error.

https://graph.facebook.com/oauth/authorize?client_id=1036465443042205&scope=offline_access,read_stream,publish_actions&r…

{

   "error": {

      "message": "Invalid redirect_uri: Given URL is not permitted by the Application configuration",

      "type": "OAuthException",

      "code": 191

   }

}

However, I was referring the given PDN article regarding integration with Facebook."https://pdn.pega.com/integration/how-to-post-updates-to-facebook-from-prpc" and followed the same approach.

PFA the error screen shot.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
September 28, 2015 - 12:58pm

Two things:

1. I think the redirect_uri value is incorrect in your request. It doesn't match the URL you gave at the time of your Facebook app registration. To get the correct value of redirect_uri, login to https://developers.facebook.com/, navigate to your app by clicking My Apps link at the top. Click Settings on the left. You will find redirect_uri mentioned under Site URL field (see screenshot below).

FB_App.png

2. You should always URL encode redirect_uri value. For example, in the above screenshot, my redirect_uri is https://foo.bar. So my authorization request should look like this:

https://graph.facebook.com/oauth/authorize?client_id=<insert_client_id_here>&redirect_uri=https%3A%2F%2Ffoo.bar

Comments

Keep up to date on this post and subscribe to comments

Pega
September 10, 2015 - 9:18am

Can you pleae check the screenshot "Authorization+code+error.PNG.png" - it appears to be microscopic when I try and view it !

September 11, 2015 - 3:17am
Response to JOHNPW_GCS

Updated the image.Please look into it.Additionally if you face any issue viewing the attached image then you can find the error description in issue description part of the query posted.

Thanks.

September 28, 2015 - 12:58pm

Two things:

1. I think the redirect_uri value is incorrect in your request. It doesn't match the URL you gave at the time of your Facebook app registration. To get the correct value of redirect_uri, login to https://developers.facebook.com/, navigate to your app by clicking My Apps link at the top. Click Settings on the left. You will find redirect_uri mentioned under Site URL field (see screenshot below).

FB_App.png

2. You should always URL encode redirect_uri value. For example, in the above screenshot, my redirect_uri is https://foo.bar. So my authorization request should look like this:

https://graph.facebook.com/oauth/authorize?client_id=<insert_client_id_here>&redirect_uri=https%3A%2F%2Ffoo.bar

October 1, 2015 - 6:40am
Response to PraneethPurighalla

Thanks for your guidance. I have generated the Authorization token from below given URL and it worked.

https://graph.facebook.com/oauth/access_token? client_id={CLIENTID}&client_secret={CLIENTSECRET}&grant_type=client_credentials

May 10, 2016 - 9:26am
Response to PrashantJ4527

How did u even get the Authentication token without redirect_uri?

May 10, 2016 - 9:27am
Response to SeshaHarikrishnaK

you will generally get it like this without redirect uri in url

{

  "error": {

  "message": "Missing redirect_uri parameter.",