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

Authentication works seamlessly with backend endpoints ($75) #499

Closed
josancamon19 opened this issue Jul 31, 2024 · 5 comments · Fixed by #507
Closed

Authentication works seamlessly with backend endpoints ($75) #499

josancamon19 opened this issue Jul 31, 2024 · 5 comments · Fixed by #507

Comments

@josancamon19
Copy link
Contributor

Is your feature request related to a problem? Please describe.
getIdToken works seamlessly with authorization endpoints in backend.

So instead of sending uid as query parameter, the app should send an Authorization header with the idToken generated by firebase.

This is 80% implemented, needs polishing, testing, and 100% working, can't have any failures.

Check what happens when the token expires, and how frequently firebase expires the token.
Check if on main there has to be some sort of silent sign In

This should work for android and ios.

@CoderMANE321
Copy link

Just to clear this up do you need Pentesting as well or just some Unit written up?

@mdmohsin7
Copy link
Collaborator

Just to clear this up do you need Pentesting as well or just some Unit written up?

He is referring to changing the uid params in the backend to use the auth util to get the current user's uid and removing the uid param in the app and replacing it with auth header

@mdmohsin7
Copy link
Collaborator

@CoderMANE321 are you working on it?

@CoderMANE321
Copy link

@mdmohsin7 Not yet, but I'll start on it today

@CoderMANE321
Copy link

@mdmohsin7 Hey, I've looked over it, and to me everything looks fine, I was looking to either implement some code or pentest but it just needs some unit tests to confirm
' token expiration - responds 401
how frequently firebase expires the token - 1 hour but firebase has token refresh method
if on main there has to be some sort of silent sign In - aren't you caching on redis couldn't you just extract the
cookie '

I didn't clone the project I only did a static analysis

Sorry if this doesn't help but I would want some more access if I was going to create these test

Good luck on the product and happy hacking =)

josancamon19 added a commit that referenced this issue Aug 3, 2024
Should close #499

Token is valid for one hour, we can keep refreshing the token as long as
the refresh token is not revoked. The refresh token gets revoked only if
the users account is deleted/disabled or revoked manually from the
backend. When the token is expired, Firebase Auth will automatically
prompt the user to log in when they open the app. The `getAuthHeader`
func refreshes the token only if it has expired or is empty or is about
to expire in 5 minutes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants