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

Add React frontend with authentication #649

Merged
merged 3 commits into from
Jul 20, 2023
Merged

Add React frontend with authentication #649

merged 3 commits into from
Jul 20, 2023

Conversation

dmtrek14
Copy link
Collaborator

  • Initial add of React frontend
  • Add audience to Python jwt handler
  • Implement OIDC auth in React frontend
  • Handle OIDC auth in the php side

These changes add a React frontend that will be the start of new pages in the application. OIDC authentication has been added as a context in the React app so that the app will have the user/token information everywhere - this makes it fairly straightforward to hit the new Python API with a bearer token. The existing php login manager was also changed in order to handle OIDC authentication.

Example pages have been set up - both in the React app and the php app - showing how to use the token from the OIDC in an Authorization header as a bearer token. On the php side, it is fastapiTest.php and on the React side, it is Dedications.jsx.

@dmtrek14 dmtrek14 requested a review from anarute July 19, 2023 21:37
@anarute
Copy link
Member

anarute commented Jul 20, 2023

Since this wasn't merged yet, I would take the opportunity to squash the refactor commit with the first commit that you introduce the React app. Maybe changing the order will make it a bit easier to rebase:

Also adding a better message in the squash commit that describes better what it does, like the description of this pull request.

.env.example Show resolved Hide resolved
'/services/getProjectUserCustomerReportJsonService.php',
//user details report: check any user
'/viewUserDetails.php',
'/services/getUserProjectCustomerReportJsonService.php'
)
);
);
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a commit just for the code styling changes? To avoid mixing it with the real changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm backing out any formatting changes for the moment, as they are distracting and not really necessary


<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->

src/.env.example Show resolved Hide resolved
These changes add a React frontend that will be the start of new pages in the application. OIDC authentication has been added as a context in the React app so that the app will have the user/token information everywhere - this makes it fairly straightforward to hit the new Python API with a bearer token.
@anarute
Copy link
Member

anarute commented Jul 20, 2023

Looks good to me, thanks!

@dmtrek14 dmtrek14 merged commit 74f1188 into main Jul 20, 2023
@dmtrek14 dmtrek14 deleted the dev branch July 20, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants