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 create session cookie feature #14

Closed
stephane-ein opened this issue Aug 18, 2020 · 7 comments · Fixed by #21
Closed

Add create session cookie feature #14

stephane-ein opened this issue Aug 18, 2020 · 7 comments · Fixed by #21

Comments

@stephane-ein
Copy link
Contributor

stephane-ein commented Aug 18, 2020

Hello,

Thanks for sharing this rust library !

But it seems like we cannot create a session cookie with this library.

It should be nice to be able to create a session cookie like described in the firebase documentation : https://firebase.google.com/docs/auth/admin/manage-cookies#create_session_cookie

I created a PR to add this feature by looking at the source code of firebase-admin-node :
https://github.com/firebase/firebase-admin-node/blob/master/src/auth/auth-api-request.ts#L971
https://github.com/firebase/firebase-admin-node/blob/master/src/auth/auth-api-request.ts#L1711

Any feedback are welcome !

@davidgraeff
Copy link
Owner

davidgraeff commented Aug 24, 2020

Hey,

thanks for the contribution. You are using jsonwebtoken as new dependency. The current code base is using biscuit for JWT, JWS etc handling (see https://docs.rs/biscuit/0.4.2/biscuit/). I don't think it's wise to have both libraries included.

I see two options:

  • Investigate if it makes sense to use jsonwebtoken instead of biscuit.
  • Rework the MR to use biscuit.

Cheers, David

@stephane-ein
Copy link
Contributor Author

Thanks for your feedback, I will look into it :)

@stephane-ein
Copy link
Contributor Author

Hello,

I did not found a function in biscuit that enable us to generate a JWT with RSA signature from a string (like the one in jsonwebtoken)
I post an issue about it 9 days ago in biscuit repo : lawliet89/biscuit#166

Regards, Stéphane

@davidgraeff
Copy link
Owner

Thanks for the PR on biscuits repo. It seems like the maintainer is currently planning a 0.5 release and is also in summer break.

I'll have a look at the jsonwebtoken crate and if it makes sense to migrate. It isn't an option to use both crates IMO.

@JadedEvan
Copy link
Collaborator

FYI - I had a chance to look at the issue that @stephane-ein posted regarding biscuit. I think that we should be able to accomplish the session cookie work using biscuit and not having to use another crate to accomplish. See my comment here

@davidgraeff
Copy link
Owner

That's great. So we can actually have session cookies even with biscuit.

I want to concentrate getting the CI working again and writing more examples this week. Would come back to this MR later, if no one else does it in the mean time.

@davidgraeff
Copy link
Owner

I have finished reworking the MR. There is an example application that creates a session cookie.

But I have no idea what to do with such a cookie. Is that supposed to be used instead of an id token to perform database operations?

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 a pull request may close this issue.

3 participants