User tests: Successful: Unsuccessful:
This will add the possibility to authenticate a user with his/her GitHub account using oAuth for authentication.
More than a possibility, it's a requirement - to be discussed ?
Currently supported:
In order to test the login feature in your local environment you will need to create an application key
and secret
for your (local) JTrackerApplication instance:
http://localhost
or a virtual host.Commenting is actually enabled only for the a project - to avoid spam...
This project is a "real" (testing) project located at: https://github.com/jtester/tests/
Note: GitHub allows the creation of "unconfirmed" accounts, so you may want to create a dummy user to avoid spamming your followers ;)
So if you have installed with the sql file from the branch you should see three projects.
Run retrieveissues.php
and retrievecomments.php
for project No. 3.
Log out.
Select the project JTestS.
Choose an issue.
Click "Login with GitHub to add a comment" at the bottom of the comments section.
A comment field should appear.
Post a comment.
Verify that the comment appears both on GitHub and in the application.
Note that this step will required the PHP exec() function to be enabled on your server, since I was lazy ;) - but this may change.
I admit that the code used for obtaining the oAuth token is far from being beautiful.
But since those are only about three lines of working code, we may wait to see what the platform will offer us in the future regarding oAuth authentication.
OK, the warning is about missing language files (my fault)
The fatal is about cUrl not available on the server - also my fault as I missed a check.
Since this is a request I have not been able to do with JHttp - could you enable cUrl (they say it goes like this) OR just put a return true
at the beginning of the function ?
Thanks for testing ;)
Hello,
after I enabled cURL, it works very well. Great work! ;)
greeting
Tobi
Does that have to be hardcoded to use curl or can we use JHttp
to get whatever it was that caused the error? Or is this just the first cut and bugs are expected?
The hard coded curl is used to make a silly redirect which is made when requesting the default GitHub avatar. Maybe it also works with JHttp aka url_fopen, and I did not found the right parameters.
The PR is more about authentication - avatars are nice but not vital...
But yes, bugs are always expected :P
This could be closed now that we're using the Framework GitHub package, right?
Well, the actual code needs to be refactored a bit now that we're using the Framework code (and some of the stuff doesn't exist now), but the issue itself is still valid.
I would even raise the priority (if possible) as I think the "user/auth/acl" part should be cleared rather sooner than later so we can move on..
The question is (still) if we really need a separate user management or if we can live with the fact that every person contributing to the tracker must have an account on GitHub.
This PR does just this and also supports the first "submitting" action allowing to submit comment on issues to GitHub.
Should I refactor ?
In terms of user management, at the most, we'll need some sort of basic ACL for some of the code. Otherwise, we don't need anything complicated. One of the ideas for later on is to have user profiles, so we'll need something linking the user accounts between the app and GitHub.
We've pretty much gotten the OK from all but the "I want nothing to do with GitHub" crowd in JBS that requiring a GitHub account is a good way to go, so we're past that battle.
Hello,
I tested this PR and get the following error message:
What is wrong? Thanks for your answers and I wish you a nice evening.
greeting
Tobi