Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3794: SSO broken #3795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/sso/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const routes = require('./routes');
require('./authentication');

const service = new Satellite({
cors: { origin: 'https://telescope.cdot.systems', credentials: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trouble we'll have here is that the origin is different depending on how you run the app: dev, staging, production.

We store this value in an environment variable named WEB_URL. It's different on every deployment. So here you should use process.env.WEB_URL.

However, we don't seem to expose this to our SSO container, see https://github.com/Seneca-CDOT/telescope/blob/master/docker/docker-compose.yml#L74-L96. You need to add it there.

And in our local dev env file https://github.com/Seneca-CDOT/telescope/blob/master/src/api/sso/env.local, which should mimic what we have in https://github.com/Seneca-CDOT/telescope/blob/master/config/env.development#L31.

There might be other things we need to make this work, but that's a start.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try this soon, is it ok if this takes a day or two? I am backed up a bit on other school work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, leave this for a while, it's not important in the next week or so.

router: routes,
beforeRouter(app) {
// Initialize and use Session and Passport middleware on the app. In production
Expand Down
2 changes: 1 addition & 1 deletion src/satellite/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function createApp(router, options = {}) {
}

// Parse application/x-www-form-urlencoded
app.use(express.urlencoded({ extended: true }));
app.use(express.urlencoded({ extended: false }));
// Parse application/json
app.use(express.json());

Expand Down