-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Keycloak OIDC #1112
base: master
Are you sure you want to change the base?
Keycloak OIDC #1112
Conversation
const query = `${QUERY_API}/v2/organizations`; // default for testing | ||
// const query = `${QUERY_API}/v2/organizations?ids=${JSON.stringify( | ||
// session.user.organization_id | ||
// )}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next step will be to update the microservices to take queries with auth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, actually, the microservices themselves don't support auth so we can do nothing on the client side for now
const query = `${QUERY_API}/v2/organizations`; // default for testing | ||
// const query = `${QUERY_API}/v2/organizations?ids=${JSON.stringify( | ||
// session.user.organization_id | ||
// )}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, actually, the microservices themselves don't support auth so we can do nothing on the client side for now
// check if the user has an org load organizations when the user changes | ||
useEffect(() => { | ||
if (user && token) { | ||
loadOrganizations(); | ||
} | ||
setUserHasOrg(!!user?.policy?.organization?.id); | ||
setUserHasOrg(!!user?.organization_id.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwynndp can you return organization id from keycloak now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though I had to choose to return an array of all the organization ids related to the group or just the id that the user is manually assigned in keycloak.
The admin panel needs to receive all the ids the way it's currently implemented so I chose to return the array.
In future we may want to return either both or just the organization id, but if we do that we'll have to handle identifying sub-organizations from the group for every api-request on the backend.
Description
Start replacing custom auth code with keycloak-oidc implementation
Issue(s) addressed
What kind of change(s) does this PR introduce?
Please check if the PR fulfils these requirements
Breaking change
Does this PR introduce a breaking change? NO