This topic is locked

Session Keys Not Working for Updates Between Applications (Single Sign On)

8/26/2020 11:47:25 PM
PHPRunner General questions
M
MikeB941 author

PHPRUNNER 10.4 - Build 35295
We have two applications we're attempting to use a single sign on for.
Both applications are set with the same PHP Session name and JWT Secret Keys.
We've used the menu builder to set links to pages that cross between the different applications as an External Page with the "Link to another application that shares the same JWT secret key" box checked.
But, users can ONLY add/update/delete records in the application they originally signed into. They can cross into the other application and list/view but if they attempt to add/update/delete they receive the message "Your session has expired. Login to save data".
They have to logout and back into the application where they want to perform an add/update/delete.
So they're able to freely move between the applications and list/view across both applications, but they can only add/update/delete on the application they ORIGINALLY signed into.
Thanks for your help.

Sergey Kornilov admin 8/27/2020

A few things come to mind

  1. Make sure that you run the latest build of PHPRunner 10.4.
  2. Make sure users/user groups in both projects match and have correct permissions assigned.
  3. Make sure you do not have any events that might be getting in the way.

M
MikeB941 author 10/12/2020

PHP RUNNER 10.4 Build 35870 (Latest)
I am still unable to get single sign on (shared Session and JWT keys) to work.
I've even created two test projects (Project1 and Project2), both have only the exact same 2 tables, the same user and group and permissions (static), the same Session and JWT keys, the menu link set up correctly with the JWT check box checked, no events of any kind and STILL it doesn't work.
I can LIST a table via the external link from one Project across to the next, but any attempt to inline edit a record receives "Error occurred >> You don't have permission to access this table login"
Similarly, an attempt to use an edit page in the other project reached by the external link will display the record for editing but when trying to save the record I receive, "Your session has expired. Login to save data."
I've cleared the browser cache as well to rule out that as an issue. This is also happening across browsers (chrome, firefox and IE)
I can see when I use the external link that a lengthy token is included in the URL.
This is the most simple set up to test single sign on (shared Session and JWT keys) and I still can't get it to work. In this test case the tables are exactly the same in both projects (Project1 and Project2).
In the real applications/projects the tables are different - we're hoping that the shared session/JWT keys executes a login with the same username across each project and then THAT project's tables/permissions apply for the logged in username on THAT project (it's not practical that all the same tables would be in all projects that we want a single sign on across)?
Thanks for your help

Sergey Kornilov admin 10/12/2020

Still hard to tell what might be wrong, it does sound like these two projects are not identical from security and permissions points of view. Troubleshooting will involve printing user permissions for the table in question after logging in to the second project.
I would also recommend testing this scenario on a different web server i.e. on localhost or on Demo Account or on your live web server.
One more thing, not sure if this relevant or not but you do not need to use both Session name and JWT keys in the same project. Just pick one method i.e. JWT and make sure that session names are different in these projects.

M
MikeB941 author 10/13/2020

Hey There Sergey -
I'll continue to experiment with my two table test projects to see if I can determine why this isn't working -
In the meantime, what I really need is a single sign on across applications that have different tables and security definitions (because the tables are different across applications) but are using the SAME username and password table for sign ons - some way that the sign on process will occur automatically as users move from one application to another -
Is there a safe way this can be implemented through event code, etc.?
Thanks for your help -

Sergey Kornilov admin 10/14/2020

This is exactly what JWT approach is for. It passes the name of the current logged in user via secure JWT token to the second project and the user will be logged in under the same username to the second project.