Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

feat(app): handle OIDC #327

Merged
merged 20 commits into from
Apr 22, 2021
Merged

feat(app): handle OIDC #327

merged 20 commits into from
Apr 22, 2021

Conversation

tevariou
Copy link
Member

No description provided.

@tevariou tevariou changed the title feat(app): handle auth feat(app): handle OIDC Apr 20, 2021
Comment on lines 61 to 62
<Button onClick={handleLogout} className={classes.button}>
<ExitToApp className={classes.icon} />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to use the startIcon and endIcon props to add icons to Mui-Buttons

Suggested change
<Button onClick={handleLogout} className={classes.button}>
<ExitToApp className={classes.icon} />
<Button
onClick={handleLogout}
className={classes.button}
startIcon={<ExitToApp className={classes.icon} />}
>

Comment on lines 67 to 72
<Button
href={OIDC_LOGIN_URL}
color="inherit"
className={classes.button}
>
<Launch className={classes.icon} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

if (isLoading) return <CircularProgress />;
if (isAuthenticated) return <Route {...routeProps} />;

return <Redirect to="/" />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not redirect to OIDC_LOGIN_URL ?

@tevariou tevariou marked this pull request as ready for review April 22, 2021 08:54
@tevariou tevariou requested review from BPierrick and a team April 22, 2021 08:55
Copy link
Contributor

@simonvadee simonvadee left a comment

Choose a reason for hiding this comment

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

don't forget to update deployment with environment variables
have you tested deploying river-api on dev to make sure it doesn't break the current pyrog ?

@@ -206,7 +206,7 @@
# CorsHeaders
# Used to access api from third-party domain

CORS_URLS_REGEX = r"^/api/.*$"
# CORS_URLS_REGEX = r"^/api/.*$"
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Before cors policies were only applied on host/api but since the oidc routes are on host/oidc, it didn't worked

@vmttn should I remove this or let it commented ?

@@ -260,6 +260,7 @@
OIDC_STORE_ACCESS_TOKEN = True
# Silently re-authenticated after following time:
OIDC_RENEW_ID_TOKEN_EXPIRY_SECONDS = int(os.environ.get("OIDC_RENEW_ID_TOKEN_EXPIRY_SECONDS", 12 * 60 * 60))
OIDC_TOKEN_USE_BASIC_AUTH = os.environ.get("OIDC_TOKEN_USE_BASIC_AUTH", False) == "True"
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The hydra clients (i'm testing with local-cohort-client) we use have this property "token_endpoint_auth_method": "client_secret_basic",

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

Copy link
Contributor

@vmttn vmttn Apr 22, 2021

Choose a reason for hiding this comment

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

Can you add a comment to remember why it's used

@tevariou tevariou merged commit d4de587 into master Apr 22, 2021
@tevariou tevariou deleted the feat/app/auth branch April 22, 2021 14:02
@tevariou tevariou linked an issue Apr 22, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate oauth authentication with the django app
4 participants