instagram Invalid header: X-Insta-Forwarded-For is required for this operation - instagram

I have a problem when I try to give a picture admired by instagram api
Error message that appears to me
stdClass Object ( [code] => 403 [error_type] => OAuthForbiddenException [error_message] => Invalid header: X-Insta-Forwarded-For is required for this operation )
Code which is used to give the image impress
print_r($instagram->likeMedia(783976945516349891_353981601));
can you help me :(

I believe what you have to do is turn off the Enforce signed header option on your Instagram API developer account.
Go to http://instagram.com/developer/clients/manage/ (you may have to log in)
Click the Edit button to the right of your application name
Scroll down to the bottom of the page and unclick the 'Enforce signed header' checkbox
Click Update Client
That should get rid of your error.

Related

Missing Access for Slash Commands

Heres the error message:
PS C:\Users\User\Documents\Discord Bot> node .
ready
C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^
DiscordAPIError: Missing Access
at RequestHandler.execute (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async RequestHandler.push (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
method: 'post',
path: '/applications/723863781607997451/guilds/722043668730740788/commands',
code: 50001,
httpStatus: 403
}
Help is appreciated.
This is my first post on stackoverflow, so if I'm posting something wrong, please tell me!
This error is caused because your Discord Bot does not have permission to create commands for that server.
There is two ways to fix this.
Option 1 - In-App Authorization
You should first navigate to the Discord Developer Portal then you should click on the bot that you are getting the issue with.
You will then be prompted with this page:
You should then click on the "OAuth" page, highlighted in red on the above screenshot.
Once you are on this page, you should find the "Default Authorization Link" setting and set it to "In-App Authorization".
Once that option is selected another option will pop up asking what permissions the bot will ask the user for, you can see the screenshot below.
Select bot and application.commands then select the permissions that your bot requires.
Then save your changes.
You will need to re-authorize your bot to the guild before it will work, you do not need to kick it - just click on your bot and click "Add to Server" and re-add it to your guild.
Option 2 - URL Generation
You should first navigate to the Discord Developer Portal then you should click on the bot that you are getting the issue with.
Once you are on that page, you should access the OAuth sub-menu titled "URL Generation" as seen below.
Once you are on this page, you will be presented with a similar output to Option 1, you should configure the scope to be bot and application.commands and then request permissions as your bot needs.
Note
You should use both of these with your Discord bot, you should use Option 1 to setup your in-app authorization permissions and then use Option 2 to get a URL for Discord Bot lists, etc.

Opencart facebook extension unexpected token

I am on version : 2.0.1.1 and when i upload the facebook extension on my opencart admin i get the following error:
"
SyntaxError: Unexpected token < in JSON at position 0
"
I hope thats sufficient information
This generally happens when a controller returns html to the view via an AJAX call and the call is expecting JSON. In my experience the unexpected token & html that is returned tends to be a server error of some sort.
To test this out, you should disable the extension, inspect element on the page and record the network traffic. Then when you enable the extension, look at the requests that are made:
Chances are, there'll be a 500 under the "Status" column, if you click the row that has the 500 on it, you'll see details of what was sent to the controller and what was returned:
You can now look at what the unexpected token actually is by clicking "Response", chances are, it's expecting a JSON response and it's getting something else altogether:
While this won't solve your issue, it will help you troubleshoot a little more effectively.

Password Reset User Flow Account Doesn't Exist Error

I have a User Flow for Password Reset set up with Email Verification. When I verify an email account that doesn't exist in our AD group, there's an error
There appears the error "An Account Could Not Be Found for this user ID".
Hitting 'Continue' causes a "Please wait while we process your information" message.
Hitting continue again a few times seems to take me to an error url like: B2C_1_ResetPassword/api/SelfAsserted/error?code=UX012 ... max retries reached
I have a Hacky Fix of sorts that binds Clicking on the Continue when the Error message is present to disabling the Continue button.
<script>
$("#continue").click(function (){
var claimVerification = $('#claimVerificationServerError:contains("account could not be found for the provided user")');
if(claimVerification.length > 0){
$("#continue").prop("disabled", true);
}
});
</script>
I have to "Enable JavaScript enforcing page layout (preview)" option turned on for this to sort of work though.
Is there a more correct solution to this issue?
As I tested with our default experiences as well as the current available templates, it doesn't seem like "Please wait while we process your information" will ever display persistently. Can you check if your css is not adding additional properties to the element used for displaying such message?
For the second scenario, it is for now by design to redirect to your client where you can setup certain logic to handle the error code "AADB2C90157" we return from the url.

Imgur API - Get 400 error when registering an application

I try to register an application, at this webpage, to upload some images to imgur.
After I select the "OAuth 2 authorization without a callback URL", enter the email, and submit the form, I will get the 400 error. As shown in the picture.
Why don't I get the successful message but the error one? Are there limits for a new user?
I see the help page at the imgur.com, and it recommends to post the question about api in here.

How can I get a token for the Drive API?

I want to implement the Google Drive API to my web application using NodeJS and I'm struggling when I try to get a token via OAuth.
I've copied the code from this guide and run the script using Node and it returns an error in this line:
var redirectUrl = credentials.installed.redirect_uris[0];
Googling around I found that I can set that variable as http://localhost:8080 and set the same value in the Authorized redirect URIs configuration in the Google Developers Console and that error goes away, fine, it works. Now it asks for a code that I should get by using an URL.
https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&response_type=code&client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8080
Then I've added the client id and enter to that URL with Chrome and then returns a connection refused error. No clue what to do in here, I searched about my problem and I can't found an answer. By looking at the direction bar in Chrome I see that there's a parameter called code and after it, there's random numbers and letters. Like this:
http://localhost:8080/?code=#/r6ntY87F8DAfhsdfadf78F7D765lJu_Vk-5qhc#
If I add any of these values it returns this error...
Error while trying to retrieve access token { [Error: invalid_request] code: 400 }
Any ideas on what should I do? Thanks.
Did you follow all the directions on the page you indicated, including all of those in Step 1 where you create the credentials in the console and download the JSON for it? There are a few things to note about creating those credentials and the JSON that you get from it:
The steps they give are a little different from what I went through. They're essentially correct, but the "Go to credentials" didn't put me on the page that has the "OAuth Consent Screen" and "Credentials" tabs on the top. I had to click on the "Credentials" left navigation for the project first.
Similarly, on the "Credentials" page, my button was labeled "Create Credentials", not "Add Credentials". But it was a blue button on the top of the page either way.
It is very important that you select "OAuth Client ID" and then Application Type of "Other". This will let you create an OAuth token that runs through an application and not through a server.
Take a look at the client_secret.json file it tells you to download. In there, you should see an entry that looks something like "redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"] which is the JSON entry that the line you reported having problems with was looking for.
That "urn:ietf:wg:oauth:2.0:oob" is a magic string that says that you're not going to redirect anywhere as part of the auth stage in your browser, but instead you're going to get back a code on the page that you will enter into the application.
I suspect that the "connection refused" error you're talking about is that you used "http://localhost:8080/" for that value, so it was trying to redirect your browser to an application running on localhost... and I suspect you didn't have anything running there.
The application will prompt you to enter the code, will convert the code into the tokens it needs, and then save the tokens for future use. See the getNewToken() function in the sample code for where and how it does all this.
You need to use this code to exchange for a token. I'm not sure with nodejs how to go about this but in PHP I would post the details to the token exchange url. In javascript you post array would look similar to this ....
var query = {'code': 'the code sent',
'client_id': 'your client id',
'client_secret': 'your client secret',
'redirect_uri': 'your redirect',
'grant_type': 'code' };
Hope this helps
Change redirect uri from http://localhost:8080 to https://localhost:8080.
For this add SSL certificates to your server.

Resources