OHDSI Home | Forums | Wiki | Github

Atlas/Webapi Authentication setup failing

(Shweta) #21

@ambuj In demo_security table do you have following columns:

  • firstname
  • middlename
  • lastname
    As WebAPI tries to query these, I remember adding these:

This is mentioned no where in the documentation but in one of the issue.

(Chris Knoll) #22

Hey, everyone,
This is excellent information that can lead to some real fixes in the code. If you already have a git issue opened on this, please add this detail explaining where the gaps are.



(Ambuj) #23

Sure, I will add these columns and try it out today. Yesterday, I tried with the credentials having access to demo_security table which again failed eventually. I have added the screenshots of everything done on git.

Please look at the git/issues where I put it in and guide me from there.
However, I will be adding columns and try it out.

(Ambuj) #24

Here are the changes I made.

  1. Added a new table under webapi schema as users.
  2. users table consists of following columns - username,password,firstName,middleName,lastName
  3. added entry in that table for ohdsi_app_user as username and its password
  4. used the same credentials in Settings.xml file to build .war file
  5. Prepared the build for webapi and atlas, deployed under tomcat with changes in config-local.js
  6. Checked to login - WORKED but no access to any of the Atlas features
  7. From sec_user_role, assigned role_id 2 (admin) to ohdsi_app_user
  8. Reload Atlas, encountered errors and unable to login, after clicking submit on credentials form, it keeps on loading something.
    Attaching all the relevant screenshots for you to refer.
    Please suggest

after changing the role_id to 2 i.e. admin as per sec_role table.

Please let me know if any additional changes you did to proceed ahead.

Thank you

  • ambuj

(Shweta) #25

The user name on upper right corner is convinencing…

Can you go to WebAPI table sec_user and see if you can see entry for ohdsi_app_user?

If yes, carry out following steps.

Becoming an Admin

You should now be able to load ATLAS and find that you can login to the environment using the newly created user and password information. However, you will have limited permissions. The following query will list the current permissions that your login has in the database:

select sec_user.id as user_id, login, sec_role.id as role_id, sec_role.name as role_name 
from sec_user join sec_user_role on sec_user.id = sec_user_role.user_id 
join sec_role on sec_user_role.role_id = sec_role.id

To grant yourself administrator privileges you can run the following query:

insert into sec_user_role (user_id, role_id) values (<your_ohdsi_app_user_user_id>,2)

Now by logging out and logging back in to ATLAS you should be granted administrative rights across the system. You will then be able to manage other permissions from the ‘Manage permissions’ section found in the configuration tab.

(Ambuj) #27

Hi Shweta,

I have also added an issue in Git and from there I got to know that we need a separate database for Security with “users” table. Things are bit confusing here.
Please refer the link and update if something comes up in your mind to figure out the issues.

  • Ambuj

(Daniel Lima) #28

I was testing this functionality today, and it seems you need at least role 1 (public) to be able to login, and 2 (admin) to edit permissions.
Then you can assign yourself the other permissions (cohorts/concept sets/atlas/sources).