Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(auth): Fix some defaults used in auth.
Browse files Browse the repository at this point in the history
- Default for login auth should just be the expected URL.
- Allow for custom port for UI.
- Update README for testing auth locally.
  • Loading branch information
mjschranz committed Jul 8, 2015
1 parent 1c291fd commit 6d3bbfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ Setup Successful!
```

### Authentication
By default running `npm start` when developing the API will be set to `http://portal.gdc.nci.nih.gov:5000` as that
is the new default for it to ensure authentication calls receive their proper cookies. If you need to change this you
can do so by creating a custom `.env` file in the root of the repository with overriding keys like those in `env.dist`.
In order to properly run the UI and login to test the auth you will need to run the application
in a specific way. This includes `sudo` and running the app on port `80`. You will need to ensure
that you don't have something else using that port (like a local apache setup).

It is important that this keeps in sync with the host the API is set to. Changing one requires keeping both up to date.
The following command should work:
`sudo GDC_API=http://portal.gdc.nci.nih.gov:5000 GDC_PORT=80 npm start`

#### Modifying /etc/hosts
In order to support local use of the login system we need to add the following
Expand Down
4 changes: 3 additions & 1 deletion app/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ function appRun(gettextCatalog: any,
notify.closeAll();
notify({
message: "",
messageTemplate: "<span>Unable to connect to the GDC API. Make sure you have accepted the Security Certificate. <br>If not, please click <a target='_blank' href='"+config.api+"/status'>here</a> and accept the Security Certificate</span>",
messageTemplate: "<span>Unable to connect to the GDC API. Make sure you have " +
"accepted the Security Certificate. <br>If not, please click " +
"<a target='_blank' href='"+config.api+"/status'>here</a> and accept the Security Certificate</span>",
container: "#notification",
classes: "alert-danger"
});
Expand Down
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ var mkdirp = require("mkdirp");

var env = {
api: process.env.GDC_API || "http://localhost:5000",
auth: process.env.GDC_AUTH || "http://localhost:8000",
base: process.env.GDC_BASE || "/"
auth: process.env.GDC_AUTH || "https://gdc.nci.nih.gov",
base: process.env.GDC_BASE || "/",
port: process.env.GDC_PORT || 3000
};

var AUTOPREFIXER_BROWSERS = [
Expand Down Expand Up @@ -393,6 +394,7 @@ gulp.task('serve:web', function (cb) {
],
baseDir: 'dist'
},
port: env.port,
host: "portal.gdc.nci.nih.gov"
// open: "external"
};
Expand Down

0 comments on commit 6d3bbfe

Please sign in to comment.