Skip to content

Commit

Permalink
Merge pull request #164 from NASA-PDS/doi-ui-159-cognito-auth
Browse files Browse the repository at this point in the history
ADD application level authentication (with Cognito)
  • Loading branch information
jordanpadams authored Sep 2, 2022
2 parents 6036668 + 8bcf1b1 commit 27a6431
Show file tree
Hide file tree
Showing 10 changed files with 1,160 additions and 317 deletions.
38 changes: 38 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PDS DOI UI - Front-end interface for pds-doi-service

Copyright 2020–2022, California Institute of Technology ("Caltech").
U.S. Government sponsorship acknowledged.

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of Caltech nor its operating division, the Jet Propulsion
Laboratory, nor the names of its contributors may be used to endorse or
promote products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


Derived Work

* The `src/AuthenticationWrapper.js` file included in this source code contains
derived work of `src/AppWithAuthentication.js` file,
which is available at https://github.com/unity-sds/unity-cs-security/blob/main/code_samples/hysds_ui_with_auth/src/AppWithAuthentication.js
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ This will install all necessary dependencies.

The config file is located at: `public/config.js` It contains the necessary HTTP request URLs for the application to function correctly. These must be changed to point to your deployed backend server.

### Update the Authentication Related Configurations

You can set these configurations also in the `public/config.js`. Make sure to use correct URL paths to match with your environment. You may check with the system admins to get the Amazon Cognito related values.

```js
window['getGlobalConfig'] = {
api: 'http://localhost:8080/PDS_APIs/pds_doi_api/0.2/',
oauth_client_id: '<CLIENT ID OF COGNITO APP CLIENT>',
oauth_redirect_uri: 'http://localhost:3000',
oauth_logout_endpoint: 'https://<COGNITO DOMAIN NAME>.auth.us-west-2.amazoncognito.com/logout',
oauth_provider_url: 'https://<COGNITO DOMAIN NAME>.auth.us-west-2.amazoncognito.com/oauth2',
app_viewer_group_name: 'PDS_Viewer',
app_admin_group_name: 'PDS_Admin',
}
```

### Run `npm start`

Runs the app in development mode.<br />
Expand Down Expand Up @@ -64,7 +80,7 @@ serve -s build

From the github release page https://github.com/NASA-PDS/pds-doi-ui/releases/

Select the latest version and dowload the zip file in assets `pds-doi-ui.zip`
Select the latest version and download the zip file in assets `pds-doi-ui.zip`

Unzip and start a standalone server

Expand All @@ -74,7 +90,7 @@ serve -s pds-doi-ui

The unzipped directory can also be configured to be published by an **apache** or **ngynx** server.

**Troobleshooting:** a serve command is also available in anaconda, be careful not to use it instead of the npm serve.
**Troubleshooting:** a serve command is also available in anaconda, be careful not to use it instead of the npm serve.

### SSH Tunnel to DOI Service

Expand Down
Loading

0 comments on commit 27a6431

Please sign in to comment.