[Office Hours] PRISMA: Authentication with JWT token #78
Unanswered
EvelynBunnyDev
asked this question in
Office Hours
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related Discussion
@dhruvna1k and I are working on firebase authentication with the chat interface. At this stage, instead of using the user credentials (username + password) for authentication, we are replacing this credential with a JWT token. Before this, we have successfully implemented a login-page, which will pop up if the user is not authenticated while attempting to access the chat interface. Successful login will generate a JWT token, which is stored in the browser cache.
userCredential.user.getIdToken().then((token) => { localStorage.setItem('token', token); // Store the token in local storage });
Our workflow is as below:
1 and 2 are implemented in the CS342/Prisma repo
3 and 4 are in Stanford HCI/Prisma, updated in matt's cloud function branch.
@PSchmiedmayer As of Feb. 29 2024, we made changes to the Swift code with extensive modifications to ChatView, and have therefore completed all steps in the workflow. We created key functions in ChatView, including:
generateJWT
,sendTokenToBackend
, andsignInWithFirebase
. Successful implementation is reflected by passing a JWT token from Swift to the web chat interface, which connects to the python backend and prints "user successfully authenticated via JWT". Our current impediment is how to test this implementation: Ideally, we would need guidance from a mentor to connect code from these two different repos (web and swift) [Realistically, which codebase shall we run? Shall we start the process in both repos or to merge them into one big repo and run?], which marks successful flow by printing the JWT token along the steps, and ultimately printing that the user has successfully logged in via JWT.Additional question: Shall we substitute the user-password approach in the visualization code (web repo) with JWT authorization?
--Outdated (start)--
Here are our current questions:
--Outdated (end)--
Reproduction
Given that there isn't a specific bug in our instance, we're gonna share our code during office hour. You can access our changes here:
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions