documentation:software:webapi:basic_security
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:software:webapi:basic_security [2018/03/19 17:30] – frank_defalco | documentation:software:webapi:basic_security [2019/04/19 16:22] (current) – anthonysena | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Basic Security Configuration ====== | + | ===== IMPORTANT NOTE ===== |
| + | |||
| + | All WebAPI documentation has moved to [[https:// | ||
| + | |||
| + | ====== Basic Security Configuration | ||
| This tutorial will demonstrate how to configure the OHDSI WebAPI and ATLAS using the OHDSI WebAPI' | This tutorial will demonstrate how to configure the OHDSI WebAPI and ATLAS using the OHDSI WebAPI' | ||
| Line 11: | Line 15: | ||
| < | < | ||
| - | < | + | < |
| < | < | ||
| < | < | ||
| Line 42: | Line 46: | ||
| OWNER to ohdsi; | OWNER to ohdsi; | ||
| </ | </ | ||
| + | |||
| + | Next you will need to insert a sample record that will contain our demonstration username and password. | ||
| + | |||
| + | https:// | ||
| + | |||
| + | And then put that password hash into the statement below. | ||
| + | |||
| + | < | ||
| + | insert into ohdsi.demo_security (email, | ||
| + | values (' | ||
| + | </ | ||
| + | |||
| + | ===== Configuring ATLAS ===== | ||
| + | |||
| + | Now that we have the OHDSI WebAPI configured, table created and populated we can now setup ATLAS to expect a secure OHDSI WebAPI. | ||
| + | |||
| + | Placing a config-local.js file inside the root atlas/js file in your web installation will allow you to override the configuration settings without requiring changes to the Github repository or accidentally pushing your local information to Github. | ||
| + | |||
| + | < | ||
| + | define([], function () { | ||
| + | var configLocal = {}; | ||
| + | |||
| + | configLocal.api = { | ||
| + | name: 'Demo Environment', | ||
| + | url: ' | ||
| + | }; | ||
| + | |||
| + | configLocal.userAuthenticationEnabled = true; | ||
| + | |||
| + | configLocal.authProviders = [{ | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }]; | ||
| + | |||
| + | return configLocal; | ||
| + | }); | ||
| + | </ | ||
| + | |||
| + | ===== 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. | ||
| + | |||
| + | < | ||
| + | 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 (1000,2) | ||
| + | </ | ||
| + | |||
| + | Now by logging out and logging back in to ATLAS you should be granted administrative rights across the system. | ||
| + | |||
| + | |||
documentation/software/webapi/basic_security.1521480604.txt.gz · Last modified: by frank_defalco
