-
Notifications
You must be signed in to change notification settings - Fork 108
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
Enable OIDC redirect in dashboard #3233
Enable OIDC redirect in dashboard #3233
Conversation
<Button | ||
variant="primary" | ||
onClick={() => {dispatch(authenticationRequest())}} | ||
> | ||
Red Hat SSO | ||
</Button> | ||
<Button variant="secondary">GitHub</Button> | ||
<Button variant="secondary">Gmail</Button> |
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.
Wasn't the idea that we'd redirect to the Keycloak broker and let it display the menu of SSO options? Are we really skipping a layer here, or redirecting directly to Red Hat?
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.
Yeah, I didn't change the button name but I should update it its not a Red Hat SSO button anymore.
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.
Even though this is dashboard code, I'd like to see this land after PR #3114.
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.
Part of your change is mutating the Redux state which, as I understand it, we are not supposed to do. Beyond that, I have a few coding suggestions.
8c7cfe4
to
de04230
Compare
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.
Looks better, but the message handling seems like it might want another tweak (and, it would be cool if you fixed the other mutations of the Redux store...).
: { type: TYPES.OPENID_ERROR } | ||
); | ||
const alert = { | ||
title: error?.response ? error.response.data?.message : error?.message, |
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 feels funny: it says "if there is an error.response
then there must be an error.response.data
which might contain a message which we can use for the title (but, if it doesn't, then use a title
of undefined
); otherwise, use a title of error.message
(or maybe undefined
). That's a lot of undefined
's....
In any case, it seems like what we want is something more like this:
title: error.response?.data?.message
? error.response.data.message
: error?.message ? error.message : "Unexpected error",
That is, if our error.response
contains a data
which contains a message
, then use that message; otherwise, if our error
contains a message
then use that message
; otherwise, fall back to a constant message.
(The current code is assuming that error.response
contains a data
which may or may not contain a message
...are we sure it contains a data
?...are we sure that data
might not contain a message
?)
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.
Okay, this is a good suggestion but I will address it in #3250, I need to do some rework there anyway.
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.
It'd be good to take Webb's error message suggestion, although perhaps that can be done in the follow-on.
Hi @portante can you consider removing the objection or reviewing it? |
Not reviewing code on the openid-connect
branch.
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
Enable OIDC redirect in the dashboard PBENCH-1072
This PR enables the redirect to the OIDC server in the dashboard by using the authentication section of the endpoints API.
It makes the following GET request to the OIDC server:
The request will redirect the user to OIDC broker login page and back to the dashboard page upon successful login
PBENCH-1072