OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
126 stars 156 forks source link

AtlasRegularSecurity breaks connection to WebAPI #2366

Closed nzurawski closed 2 months ago

nzurawski commented 2 months ago

I have an installation of WebAPI and Atlas setup with SSL enabled on WebAPI, and the site loading over a secure connection on port 443. If I leave SSL enabled and set security.provider to DisabledSecurity, the application is able to call the WebAPI succesfully. However, if I set security.provider to AtlasRegularSecurity, the application is no longer able to get a response from WebAPI with a 401 error showing in Chrome's developer tools. The Stdout log file from Apache Tomcat shows no errors.

Why would enabling AtlasRegularSecurity cause the WebAPI to refuse the connection from Atlas?

Copies of WebAPI settings and Atlas Config-local attached here. config-local.txt settings.txt

chrisknoll commented 2 months ago

You also need to configure Atlas to enable security. When you changed to AtlasRegularSecurity, did you update your config-local.js file to indicate security is enabled?

nzurawski commented 2 months ago

HI Chris, yes I did.

Here's what teh config-local looks like: define([], function () { var configLocal = {};

configLocal.UserAuthenticationEnabled = true;

configLocal.api = {
    name: 'REDACTED',
    url: 'https://atlas-dev.REDACTED.org:8443/WebAPI/'
};

configLocal.authProviders = [{
    "name": "Local Security Test DB",
    "url": "user/login/db",
    "ajax": true,
    "icon": "fa fa-database",
    "isUseCredentialsForm": true
  }

  ];

return configLocal;

}); Am I missing something?

chrisknoll commented 2 months ago

It's case sensitive.

configLocal.userAuthenticationEnabled = true;

Also, you'll know if you are in security enabled mode if you see a 'sign in' button at the top of the UI.

nzurawski commented 2 months ago

Well that's embarassing for me. Thanks. I'm in business now.