-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
SSO for BE and ResourceAPI #82
Comments
@aaron-suarez @AllenAnthes |
@jack-robs Could you explain the issue a bit ? |
I can expand on this a little @pegasus-lynx When we wrote the authentication for the Resources API, we did it more with systems users in mind because we weren't sure how all it would be used but we knew that we wanted to integrate with the OC Backend (BE) as well as Slackbot. So we decided to issue out API keys, which you obtain by making a request to As you might imagine, this isn't really a great workflow for the frontend to use to communicate with the Resources API. The user flow would go like this.
So the idea is that if you're already logged into Operation Code, you have some type of session key or JWT anyway. This issue will be resolved when the Resources API can accept the session cookie from the OC backend as credentials for creating/updating resources. There are a few ways to accomplish this, but I think that the most straightforward way is to take the cookie (or jwt or whatever we're using on the main site) and pass it to the create/update endpoints. The Resources API would then ask the backend "hey is this cookie valid?" and if the backend responds "yes" then perform the operation. If the backend doesn't respond yes, return a 401. I'm not sure how session management works on the frontend/backend, so there might be work to get something that is accessible by the frontend to be able to pass it to the Resources API. @AllenAnthes can probably speak to that, or you can look at the code and see how it works. If you have any questions about anything I said above or the work needed for the Resources API, I can explain it further, just ask. |
Feature request
Stretch goal from Aaron S., SSO for BE and Resources API so we can create/update resources using logged in session rather than providing API key
Proposed solution
From Allen: if user is logged in an they have a valid JWT stored as cookie. This is already added to the auth header for any req's sent to backend.
From Aaron: could require some changes to resources API to do that
-> if requests also go to the Resources API, can just post key to /auth/token/verify
Potential alternative solutions
UK
Additional context
Next step planning after new website launch # @
The text was updated successfully, but these errors were encountered: