2 Apr #1

Flyover 2.0 - GitHub Authentication not working

Ultimate subscriber
Hi Shade, thank you very much for your awesome plugin!

I have set up a GitHub App for authentication and tried it out.
Unfortunately the only answer I get is:

Fatal error: Uncaught TypeError: Argument 1 passed to Flyover\User\Userload() must be of the type array, boolean given, called in /www/htdocs/w0189554/forums.prydeworx.com/flyover.php on line 443 and defined in /www/htdocs/w0189554/forums.prydeworx.com/flyover/User/User.php:34 Stack trace: /www/htdocs/w0189554/forums.prydeworx.com/flyover.php(443): Flyover\User\User->load(false) #1 {main} thrown in /www/htdocs/w0189554/forums.prydeworx.com/flyover/User/User.php on line 34

The problem is, that the array $accounts is empty, and reset($accounts) then returns false. This condition isn't questioned, only whether the count is greater than 1 or not. In this case it is zero.

I tried with my GitHub credentials and with a wrong password, and tested with plain and extended redirect URI.

What could be the issue here?
  • 1
  • 2
Shade 2 Apr
#2
Hello, thanks for the report. A nicer error message will be prompted in the next version. It's working fine in my tests here, so I suppose either the credentials given or GitHub's tokens are incorrect. Can you confirm?
Yamakuzure 2 Apr
#3
I tried to register a GitHub OAuth application. Unfortunately with the same result, but that seemed to be the wrong way anyway.
Shade 2 Apr
#4
Can you please reach me out on Discord? Shade#7731

Thank you
Yamakuzure 2 Apr Edited
#5
Hello, thanks for the report. A nicer error message will be prompted in the next version. It's working fine in my tests here, so I suppose either the credentials given or GitHub's tokens are incorrect. Can you confirm?
Shade (2 Apr)
I have logged out and back in with on my GitHub Account, and am pretty sure that the password is correct.
As tokens I used "Client ID" and "Client Secret".

Can you please reach me out on Discord? Shade#7731

Thank you
Shade (2 Apr)
I do not have a discord account. But I have to go now anyway. It isn't mission critical to get the integration working right right now. ;-)
Thank you very much for your help, I'll look into it again tonight and will report back to you when I find something out.

A little update:
The error is gone and replaced by my forum telling me:

Signed API request has returned an error. HTTP error 401. Raw Provider API response: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}.

I think I have definitely done something wrong here...
Shade 2 Apr
#6
Yes, bad credentials is usually prompted when a provider's tokens are not entered properly. Please make some screenshots of your current GitHub configuration.
Yamakuzure 2 Apr Edited
#7
Hmmm... I tested the GitHub access on MyBBoost, and it registered an OAuth application.

So I created one again. Seems to be the correct way then, but it changed nothing.

Hang on, I'll put in the screenshots

https://ibb.co/2n8v5f2
https://ibb.co/yqkGKTk
Shade 2 Apr
#8
Yes, it should work. Are you sure you have entered the correct redirect URI?
Yamakuzure 2 Apr
#9
Yes, I copied and pasted the one from the admin panel. It says to try a bare URL if the full one isn't working, which I tried, too.

I just tried something else:
1. Changed primary e-mail address on GitHub, so a different one as the one used on the forum is used.
2. Changed my username in the forum, as it was the same as on GitHub.

Still no success, but I have another idea.

(Is it a problem that I use PHP-7.2?)
Shade 2 Apr
#10
Make sure there are no blank spaces in the pasted tokens, especially towards their end. PHP 7.2 poses no issues, I'm using it too. Note that Flyover doesn't mind if you are using equal names or emails, as authentication is performed on a hashed identifier level which does not depend on them.