laravel socialite facebook loging error This authorization code has been used - laravel-socialite

i am using lavel/socialite in laravel project version 5.4
Now i am facing an error
ClientException
Client error: `POST https://graph.facebook.com/v3.0/oauth/access_token`
resulted in a `400 Bad Request` response:{"error":{"message":"This
authorization code has been used.","type":"OAuthException", "code":100,
"fbtrace_id":"F7xwAj18Ez (truncated...)
some times it working and sometimes showing this error.
have any suggestions to solve the issue.

in some cases, you can use a simple condition
if (!$request->has('code') || $request->has('denied')) {
return redirect('/');
}
because when you try more than once facebook will not allow for gave information request.

Related

Cypress can't access a website from its automated browser (used to work normally and other browsers access normally)

I was hoping one of you could help me out here. I ran out of ideas already.
I have a script with Cypress.io that basically access a website and clicks on a link for LOGIN. I have reduced the code to only access the LOGIN page directly, which was working perfectly for the past 1-2 months, but in the past week I ran the script and it's no longer working.
When it tries to access the URL https://sso.tce.sp.gov.br/cas-server/login it gives the error below.
The most weird thing is that I can access this URL manually from the other non-automated (EDGE, Chrome), but when I try to do it with the Cypress automated browser it doesn't work.
cy.visit() failed trying to load:
https://sso.tce.sp.gov.br/cas-server/login
We attempted to make an http request to this URL but the request
failed without a response.
We received this error at the network level:
Error: Parse Error: Duplicate Content-Length
Common situations why this would fail:
you don't have internet access
you forgot to run / boot your web server
your web server isn't accessible
you have weird network configuration settings on your computer
Apparently it's doesn't look like a proxy thing nor a code thing, do you guys have any idea of what it could be?
Code:
describe('Test', () => {
it('Access AUDESP Website', function () {
Cypress.config('chromeWebSecurity',false);
//cy.visit('https://www.tce.sp.gov.br/audesp')
//cy.get('.menu-superior-itens > [href="https://sso.tce.sp.gov.br/cas-server/login"]').click()
cy.visit('https://sso.tce.sp.gov.br/cas-server/login')
})
})
Any ideas would be very helpful!!
Thank you!
UPDATE:
Guys, I'm still with this error, but I have found out that the website is sending a duplicate header, but cypress is not able to process it. The browser, outside of Cypress, ignores it apparently... any ideas on how to fix it on Cypress?

Discord BOT not logging in (anymore)

i made a Discord bot which was working just fine until recently; since yesterday it's refusing to log in (output says invalid token was provided but creating a new token and putting it into code won't work).
The funny part is I actually have two versions of the same bot (deploy and test where the latter is only in one of my servers where i test new functions before implementing them in the deployed version).
Just replacing the token with the "test-bot" one fix the issue and allows me to correctly login (with the wrong bot of course since I'm using bot-test token).
To verify the token i made this very small script:
client.login(botToken).then().catch(reason => {
console.log("Login failed: " + reason);
console.log("Token used: " + botToken);
}); //login in discord
This allows me, in case of failed login to have similiar output:
Login failed: Error [TOKEN_INVALID]: An invalid token was provided.
Token used: NjAxMzc3Mzg3NDgwODc1MDE4.Xr5Cyg.xhX3QYqk0prPC7y3KS0yc5JA02U
Here you can see a screenshot from discord bot page where you can double-check the token used IS correct (the token now has been reset so this one won't be valid anymore)
I can tell the import method of the token (it's imported from another file) works fine (bot.js can see it and what i actually do when I change version is commenting/decommenting 2 lines of code (containing token and client ID which is used by a bot function).
Additional info:
I'm using Discord 12 at the moment but the bug started yesterday giving out the same result and I had installed discord 11+ back then.
nodejs version used is 12.16.3
npm version used is 6.14.4
bot is hosted in a VPS running Debian 9
Is anyone able to help with this or encountered similiar error?
Thanks in advance,

How do I manually refresh-token while creating apps using Zapier CLI

I want to perform refresh token but my gateway gives HTTP response 403 instead of 401 so I cannot use 'autoRefresh' feature of Zapier.
I tried throwing 'RefreshTokenException' when the response status is 403 as given below:
return responsePromise
.then((response) => {
if (response.status == 403) {
throw new RefreshTokenException();
}
...
});
But upon doing this I get an Error from Zapier (while creating zaps) stating:
RefreshTokenException is not defined
Can anyone help me with manually refreshing token using Zapier CLI platform for app creation?
David here, from the Zapier Platform team. Sorry for the slow reply, we're just now seeing some of these.
It's not defined because that's not an error we define. You've got the right idea, you just need to use RefreshAuthError instead. See these docs.
​Let me know if you've got any other questions!

Appcelerator Google SignIn using module Ti.GoogleSignIn

Using Ti.GoogleSignIn module by Hansemann, i am trying to access my google drive. Problem is that the google does not honour the token i am getting from module and i am getting Error 401 : Unauthorized Invalid credentials.
On the other hand, if i use the token from Google developer playground, it works as expected.
I am setting the scope in the following way
Google.initialize({
clientID : "***********************************************.apps.googleusercontent.com",
scope : ['https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.metadata'] // Scope
});
So when using a clientID from the playground, it works in your app? Then your current setup may be incorrect. As the error seems to be thrown for both the Titanium based version and native version (bubbled up), you may receive some more help from the native community as well.

Using Nodejs and Passport-Amazon - getting "We're sorry" error

When setting up Oath using the Amazon strategy in the NodeJS Passport module, I'm seeing a generic error page when trying to authenticate. The same error occurs whether running it in my app or running the example app from here:
https://github.com/jaredhanson/passport-amazon/tree/master/examples/login
I'm using the correct credentials (client id and secret) from the Amazon's Sellercentral. Has anyone else got this to work?
On further investingation, I found a comment in the source:
<!--
Error Code: 400
Error Message: The redirect URI you provided has not been whitelisted for your application
-->
After adding the callback URL to the "Allowed return URLs", it now works.

Resources