pow icon indicating copy to clipboard operation
pow copied to clipboard

POW with MongoDB

Open shahryarjb opened this issue 1 year ago • 2 comments

Hello, I want to migrate to POW library because I have an auth provider that supports the JWT with auth2 protocol, however updating this part of my software will be quite difficult. I have few inquiries.

Since my database is mongodb, how can I personalize every POW feature for this kind of database? where should I begin with this?

My provider library has three different methods of authentication, and I'm wondering if POW can handle them all.

  • Server side sessions and cookies on user client websites such as nextjs and reactjs;
  • Auth2 (access token and refresh token)
  • a simple session for my LiveView(default phoenix)

I have read this link https://hexdocs.pm/pow/api.html, I think it gives me full access to api for creating tokens and refresh it, without needing Postgres or stored user? am I right?


  1. My big problem is forcing the POW get user data from my mongodb, how can do it (CRUD)?

  2. and my second requirement is how can I be able to create server side cookie on another domain for the known front websites that want to communicate with me?


I appreciate all of your work; maintaining an authentication library is challenging and requires a lot of resources.

Thank you in advance

shahryarjb avatar Feb 12 '24 19:02 shahryarjb

@danschultzer can I have your help please?

shahryarjb avatar Feb 18 '24 06:02 shahryarjb

If you search hex, then you will find a Postgres store: https://hex.pm/packages?search=Pow&sort=recent_downloads

That should have everything you’ll need to write your own MongoDB store.

Schultzer avatar Feb 18 '24 21:02 Schultzer