ory / fosite-example

Apache License 2.0
78 stars 34 forks source link

How do I use storage with postgresql, not memory storage? #11

Closed mirazero closed 6 years ago

mirazero commented 6 years ago

This is very nice library. I am getting a lot of help from this library. I want to use a postgresql as storage. It's very complicated to me. Could you please advice to me about that ?

thanks

aeneasr commented 6 years ago

You will need to rewrite this to use database/sql and PostgreSQL.

gauravbansal74 commented 6 years ago

@arekkas Can you help us to provide any reference for "How to user storage with PostgreSQL"?

@mirazero Can you help if you have implemented?

aeneasr commented 6 years ago

@gauravbansal74 my advice is to use https://github.com/ory/hydra

gauravbansal74 commented 6 years ago

Thank you for the reply @arekkas. Hydra has limitation. so we don't want to have those limitations in our application.

aeneasr commented 6 years ago

If you are referring to the password credentials grant, which you probably are, I advise you strongly and forecefully to throw away that requirement. It's ancient, insecure, bad practice.

In any case, Hydra ships a SQL store for fosite, see: https://github.com/ory/hydra/blob/master/oauth2/fosite_store_sql.go

kpritam commented 2 years ago

We have legacy system and we are also hitting password grant limitation of hydra. We plan to use fosite but it does not have postgres store implementation. And it is hard to find out all the interfaces postgres store will need to implement. Can someone point out all the interfaces that are required to implement by this new store?