These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

phpBB 3.2 EVE SSO / ESI extension [beta]

Author
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#41 - 2017-03-31 20:31:20 UTC
The extension now enables fine, but when attempting to log in, I now get

{"error":"invalid_request","error_description":"The callback URI doesn't match the value stored for this client"}


Resetting the auth method to db via mysql doesn't appear to circumvent this, so I'm a bit stuck.
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#42 - 2017-03-31 20:40:38 UTC
This is due to a fix I added for people without mod rewrite. The mod nowbtells in the authentication settings what the callback should be. In your case, since you obviously have mod rewrite, go to acp -> general -> server config -> server and domain and enable url rewriting, clear the cache and it should be working.
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#43 - 2017-03-31 20:43:09 UTC  |  Edited by: Milo Caman
Snitch Ashor wrote:
This is due to a fix I added for people without mod rewrite. The mod nowbtells in the authentication settings what the callback should be. In your case, since you obviously have mod rewrite, go to acp -> general -> server config -> server and domain and enable url rewriting, clear the cache and it should be working.


Is there any way to do this via mysql (specifically url rewriting) as I'm currently locked out of my own forum P

EDIT: Manually cleared the cache via FTP and changed the url rewrite setting with:

UPDATE phpbb_config SET config_value = '1' WHERE config_name = 'enable_mod_rewrite' LIMIT 1;


EDIT 2: This got me back into the ACP, but after enabling sso again and checking that url rewriting was on, I'm having the same issue again.

EDIT 3: Changing the URL by removing '%2Fapp.php' manually allows me to login with SSO enabled. This suggests that mod_rewrite might not be working properly? Also the 'Extensions' tab seems to be missing once I get back into ACP with everything enabled.
Syenna Celeste
Stormghosts
#44 - 2017-03-31 23:05:27 UTC
Milo Caman wrote:
[
EDIT 3: Changing the URL by removing '%2Fapp.php' manually allows me to login with SSO enabled. This suggests that mod_rewrite might not be working properly? Also the 'Extensions' tab seems to be missing once I get back into ACP with everything enabled.


Fixed (we think).


Line 115 login.php.

Old: $url = $authurl."?response_type=code&redirect_uri=".rawurlencode(append_sid(generate_board_url().'/app.php/authevesso/login'))."&client_id=".$this->settings['clientid']."&scope=".im plode(' ',$scopes)."&state=".$state;


New: $url = $authurl."?response_type=code&redirect_uri=".rawurlencode(append_sid(generate_board_url().'/authevesso/login'))."&client_id=".$this->settings['clientid']."&scope=".im plode(' ',$scopes)."&state=".$state;

Put your hands around my heart and squeeze me until I'm dry.

Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#45 - 2017-04-01 05:47:18 UTC  |  Edited by: Snitch Ashor
Syenna Celeste wrote:
Milo Caman wrote:
[
EDIT 3: Changing the URL by removing '%2Fapp.php' manually allows me to login with SSO enabled. This suggests that mod_rewrite might not be working properly? Also the 'Extensions' tab seems to be missing once I get back into ACP with everything enabled.


Fixed (we think).


Line 115 login.php.

Old: $url = $authurl."?response_type=code&redirect_uri=".rawurlencode(append_sid(generate_board_url().'/app.php/authevesso/login'))."&client_id=".$this->settings['clientid']."&scope=".im plode(' ',$scopes)."&state=".$state;


New: $url = $authurl."?response_type=code&redirect_uri=".rawurlencode(append_sid(generate_board_url().'/authevesso/login'))."&client_id=".$this->settings['clientid']."&scope=".im plode(' ',$scopes)."&state=".$state;


Thanks, did overlook that. So you can use that change for now, or change the callback at the eve dev page.

EDIT: Just pushed a fix here: https://bitbucket.org/snitchashor/php-ext-authevesso/downloads/php-ext-authevesso-v1.0.7a.zip

In order not to get locked out. If you had used version <= 1.0.5 and it worked, got to ACP -> General -> Server Confg. -> Server and domain and enable url rewriting.

After that continue normal:

disable the extension, update files, clear chache, reenable
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#46 - 2017-04-01 09:23:59 UTC
Installed 1.0.7a just fine and logins seem to be working perfectly again, thanks Smile

Still not seeing the extensions tab though. Were some functions moved elsewhere?
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#47 - 2017-04-03 21:54:11 UTC
Milo Caman wrote:
Installed 1.0.7a just fine and logins seem to be working perfectly again, thanks Smile

Still not seeing the extensions tab though. Were some functions moved elsewhere?


I'm afraid no. This means the migrations again didnt install properly for you. Will have a look but unfortunately its something I cannot reproduce.
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#48 - 2017-04-04 12:58:41 UTC
Snitch Ashor wrote:
Milo Caman wrote:
Installed 1.0.7a just fine and logins seem to be working perfectly again, thanks Smile

Still not seeing the extensions tab though. Were some functions moved elsewhere?


I'm afraid no. This means the migrations again didnt install properly for you. Will have a look but unfortunately its something I cannot reproduce.


Hrm.

Would running the query from before fix this? Is it even possible to do the migrations manually via the cli or mysql?
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#49 - 2017-04-04 19:34:10 UTC  |  Edited by: Snitch Ashor
Milo Caman wrote:
Snitch Ashor wrote:
Milo Caman wrote:
Installed 1.0.7a just fine and logins seem to be working perfectly again, thanks Smile

Still not seeing the extensions tab though. Were some functions moved elsewhere?


I'm afraid no. This means the migrations again didnt install properly for you. Will have a look but unfortunately its something I cannot reproduce.


Hrm.

Would running the query from before fix this? Is it even possible to do the migrations manually via the cli or mysql?


Sorry no. There are three migrations, one does database stuff, one installs the acp module and one inserts the teamspeak profile field. Can you check if the last one is there?

And can you please run the following sql query send me the output:
SELECT * FROM `phpbb_migrations` WHERE `migration_name` LIKE '%snitch%'
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#50 - 2017-04-05 12:42:49 UTC  |  Edited by: Milo Caman
Installed migrations listed as per CLI output are:


* \snitch\authevesso\migrations\add_table_100
* \snitch\authevesso\migrations\version_104
* \snitch\authevesso\migrations\version_101
* \snitch\authevesso\migrations\profilefield_tsid_100
* \snitch\authevesso\migrations\add_module_100


The output from the query is as follows:


Database changed
mysql> SELECT * FROM `phpbb_migrations` WHERE `migration_name` LIKE '%snitch%';
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
| migration_name                                      | migration_depends_on
                                                                                                                     | m
igration_schema_done | migration_data_done | migration_data_state | migration_start_time | migration_end_time |
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
| \snitch\authevesso\migrations\add_module_100        | a:1:{i:0;s:34:"\phpbb\db\migration\data\v31x\v314";}
                                                                                                                     |
                   1 |                   1 |                      |           1490953922 |         1490953923 |
| \snitch\authevesso\migrations\add_table             | a:1:{i:0;s:34:"\phpbb\db\migration\data\v31x\v314";}
                                                                                                                     |
                   1 |                   1 |                      |                    0 |                  0 |
| \snitch\authevesso\migrations\add_table_100         | a:1:{i:0;s:44:"\snitch\authevesso\migrations\add_module_100";}
                                                                                                                     |
                   1 |                   1 |                      |           1490953923 |         1490966569 |
| \snitch\authevesso\migrations\profilefield_tsid     | a:1:{i:0;s:48:"\phpbb\db\migration\data\v310\profilefield_types"
;}                                                                                                                   |
                   1 |                   1 |                      |           1489791031 |         1489791031 |
| \snitch\authevesso\migrations\profilefield_tsid_100 | a:1:{i:0;s:48:"\phpbb\db\migration\data\v310\profilefield_types"
;}                                                                                                                   |
                   1 |                   1 |                      |                    0 |                  0 |
| \snitch\authevesso\migrations\version_101           | a:3:{i:0;s:44:"\snitch\authevesso\migrations\add_module_100";i:1
;s:43:"\snitch\authevesso\migrations\add_table_100";i:2;s:51:"\snitch\authevesso\migrations\profilefield_tsid_100";} |
                   1 |                   1 |                      |           1490966569 |         1490966569 |
| \snitch\authevesso\migrations\version_104           | a:1:{i:0;s:41:"\snitch\authevesso\migrations\version_101";}
                                                                                                                     |
                   1 |                   1 |                      |           1490966569 |         1490991678 |
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
7 rows in set (0.01 sec)


It's a bit messy but hope it helps?

EDIT: New users are now reporting the following error when attempting to log in for the first time:

General Error
SQL ERROR [ mysqli ]

Incorrect integer value: '' for column 'user_avatar_width' at row 1 [1366]


Guessing this is related to the migrations not being installed properly?
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#51 - 2017-04-05 22:06:43 UTC  |  Edited by: Snitch Ashor
Milo Caman wrote:
Installed migrations listed as per CLI output are:


* \snitch\authevesso\migrations\add_table_100
* \snitch\authevesso\migrations\version_104
* \snitch\authevesso\migrations\version_101
* \snitch\authevesso\migrations\profilefield_tsid_100
* \snitch\authevesso\migrations\add_module_100


The output from the query is as follows:


Database changed
mysql> SELECT * FROM `phpbb_migrations` WHERE `migration_name` LIKE '%snitch%';
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
| migration_name                                      | migration_depends_on
                                                                                                                     | m
igration_schema_done | migration_data_done | migration_data_state | migration_start_time | migration_end_time |
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
| \snitch\authevesso\migrations\add_module_100        | a:1:{i:0;s:34:"\phpbb\db\migration\data\v31x\v314";}
                                                                                                                     |
                   1 |                   1 |                      |           1490953922 |         1490953923 |
| \snitch\authevesso\migrations\add_table             | a:1:{i:0;s:34:"\phpbb\db\migration\data\v31x\v314";}
                                                                                                                     |
                   1 |                   1 |                      |                    0 |                  0 |
| \snitch\authevesso\migrations\add_table_100         | a:1:{i:0;s:44:"\snitch\authevesso\migrations\add_module_100";}
                                                                                                                     |
                   1 |                   1 |                      |           1490953923 |         1490966569 |
| \snitch\authevesso\migrations\profilefield_tsid     | a:1:{i:0;s:48:"\phpbb\db\migration\data\v310\profilefield_types"
;}                                                                                                                   |
                   1 |                   1 |                      |           1489791031 |         1489791031 |
| \snitch\authevesso\migrations\profilefield_tsid_100 | a:1:{i:0;s:48:"\phpbb\db\migration\data\v310\profilefield_types"
;}                                                                                                                   |
                   1 |                   1 |                      |                    0 |                  0 |
| \snitch\authevesso\migrations\version_101           | a:3:{i:0;s:44:"\snitch\authevesso\migrations\add_module_100";i:1
;s:43:"\snitch\authevesso\migrations\add_table_100";i:2;s:51:"\snitch\authevesso\migrations\profilefield_tsid_100";} |
                   1 |                   1 |                      |           1490966569 |         1490966569 |
| \snitch\authevesso\migrations\version_104           | a:1:{i:0;s:41:"\snitch\authevesso\migrations\version_101";}
                                                                                                                     |
                   1 |                   1 |                      |           1490966569 |         1490991678 |
+-----------------------------------------------------+-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------+--
---------------------+---------------------+----------------------+----------------------+--------------------+
7 rows in set (0.01 sec)


It's a bit messy but hope it helps?

EDIT: New users are now reporting the following error when attempting to log in for the first time:

General Error
SQL ERROR [ mysqli ]

Incorrect integer value: '' for column 'user_avatar_width' at row 1 [1366]


Guessing this is related to the migrations not being installed properly?


This is due to the fact that you can not access the acp settings and set the avatar size. Can you please disable the mod, clear the cache, and delete the migrations row \snitch\authevesso\migrations\add_module_100 and then reenable it? Also please check if the extensions tab is present if you disable the extension and log in with your regular admin account, might be a permission problem...

Edit: Please check with disabled mod and regular admin first. If it shows up there, please do the following: Reenable the mod, search the phpbb_users table for you admin eve char, delete the row and log in with that character again, it should show up now.
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#52 - 2017-04-05 23:04:32 UTC
Doesn't look like it's a permissions issue, a regular admin doesn't see the extensions tab either.

How would I go about removing the add_module_100 migrations row? With the mod disabled db:list no longer shows the migrations as installed or available. Would it be worth deleting the extension's data again or might this just cause further problems?
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#53 - 2017-04-05 23:14:13 UTC
Milo Caman wrote:
Doesn't look like it's a permissions issue, a regular admin doesn't see the extensions tab either.

How would I go about removing the add_module_100 migrations row? With the mod disabled db:list no longer shows the migrations as installed or available. Would it be worth deleting the extension's data again or might this just cause further problems?


That might work as well but i would just delete the table row first, e.g. using phpmyadmin if you have, if not, its

DELETE FROM `phpbb_migrations` WHERE `phpbb_migrations`.`migration_name` = \'\\\\snitch\\\\authevesso\\\\migrations\\\\add_module_100\'
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#54 - 2017-04-05 23:21:26 UTC  |  Edited by: Milo Caman
mysql does not like this query at all and makes a big fuss about the backslash characters, should it just be something like:

DELETE FROM `phpbb_migrations` WHERE `phpbb_migrations`.`migration_name` = '\snitch\authevesso\migrations\add_module_100';

instead?

EDIT: The exact output is:

mysql> DELETE FROM `phpbb_migrations` WHERE `phpbb_migrations`.`migration_name` = \'\\\\snitch\\\\authevesso\\\\migrations\\\\add_module_100\'
ERROR:
Unknown command '\''.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\''.
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'\\\\snitch\\\\authevesso\\\\migrations\\\\add_module_100\'' at line 1
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#55 - 2017-04-05 23:47:01 UTC  |  Edited by: Snitch Ashor
Milo Caman wrote:
mysql does not like this query at all and makes a big fuss about the backslash characters, should it just be something like:

DELETE FROM `phpbb_migrations` WHERE `phpbb_migrations`.`migration_name` = '\snitch\authevesso\migrations\add_module_100';

instead?

EDIT: The exact output is:

mysql> DELETE FROM `phpbb_migrations` WHERE `phpbb_migrations`.`migration_name` = \'\\\\snitch\\\\authevesso\\\\migrations\\\\add_module_100\'
ERROR:
Unknown command '\''.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\''.
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'\\\\snitch\\\\authevesso\\\\migrations\\\\add_module_100\'' at line 1


DELETE FROM phpbb_migrations WHERE migration_name = '\snitch\authevesso\migrations\add_module_100'; should do.

Edit: If you havent done this yet can you check in the acp-system-module management-acp, in the very bottom there should be a dropdown and one of the entries should be something like snitch/authevesso/main module.
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#56 - 2017-04-06 08:35:17 UTC
Snitch Ashor wrote:

Edit: If you havent done this yet can you check in the acp-system-module management-acp, in the very bottom there should be a dropdown and one of the entries should be something like snitch/authevesso/main module.


Enabling the snitch/authevesso/main settings module fixed everything! Seems like new users can create accounts now, and I have full access to the settings module.

Thanks so much for all your help with this!
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#57 - 2017-04-07 14:21:38 UTC
New day, new problem!

Looks like the groups_check.php cronjob isn't being run by the system. I don't seem to be able to run it manually either as it returns the below:

Class 'phpbb\cron\task\base' not found in /var/www/html/forum/ext/snitch/authevesso/cron/groups_check.php on line 20


I'm going to go out on a limb and assume that this is migration-related, but I'm not really sure how phpbb handles it's internal crons. I had a poke around, but I'm feeling a bit lost in it all. Any ideas?
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#58 - 2017-04-08 19:45:24 UTC  |  Edited by: Snitch Ashor
Milo Caman wrote:
New day, new problem!

Looks like the groups_check.php cronjob isn't being run by the system. I don't seem to be able to run it manually either as it returns the below:

Class 'phpbb\cron\task\base' not found in /var/www/html/forum/ext/snitch/authevesso/cron/groups_check.php on line 20


I'm going to go out on a limb and assume that this is migration-related, but I'm not really sure how phpbb handles it's internal crons. I had a poke around, but I'm feeling a bit lost in it all. Any ideas?


No for once this has nothing to do with the migrations. Looks like its unable to find the cron base class which is part of phpbb. How did you try to run the cron job manually? It requires the phpbb enviroment so if you want to run it manually, try php path_to_forum/bin/phpbbcli.php cron:run cron.task.groups_check and let me know if that works.
Milo Caman
Anshar Incorporated
Monyusaiya Industry Trade Group
#59 - 2017-04-09 10:03:51 UTC
When I tried to run it manually, I just navigated to /ext/snitch/authevesso/cron and ran the script with php.

Trying to run the task from cli gives me the following:


php bin/phpbbcli.php cron:run cron.task.groups_check


  [RuntimeException]
  Could not find cron task “cron.task.groups_check”.
Snitch Ashor
The Mjolnir Bloc
Templis CALSF
#60 - 2017-04-09 13:27:53 UTC
Milo Caman wrote:
When I tried to run it manually, I just navigated to /ext/snitch/authevesso/cron and ran the script with php.

Trying to run the task from cli gives me the following:


php bin/phpbbcli.php cron:run cron.task.groups_check


  [RuntimeException]
  Could not find cron task “cron.task.groups_check”.


Can you please post the output of
php bin/phpbbcli.php cron:list

If groups_check shows up as ready to be run please run

php bin/phpbbcli.php cron:run

Which runs all crons and then list again to check if groups moved to the not ready Section.