thephpleague / oauth2-server-bundle

Symfony bundle for the OAuth2 Server.
MIT License
180 stars 88 forks source link

Is using Doctrine ODM possible ? #103

Open etshy opened 1 year ago

etshy commented 1 year ago

I only saw ORM references to store token but I prefer ask in case I missed something. There is currently no way to use Doctrine ODM right ? I didn't see any way to make my own persitence either.

chalasr commented 1 year ago

Indeed. I won't work on this myself, but I would welcome a PR adding support for the ODM.

etshy commented 1 year ago

I won't garantee I'll do it but I'll take a look. (I started to make my own implementation of oauth2-server for my current project though)

imdhemy commented 1 year ago

I accidentally deleted my previous comment.


@etshy

What do you think about using:

For Tokens

For clients

etshy commented 1 year ago

@imdhemy You mean for my implementation ? I already choose to use Lexik bundle to create the token, and add data to it. I didn't know about the RefreshTokenBundle though, thanks a lot.

spiider8 commented 1 year ago

I won't garantee I'll do it but I'll take a look. (I started to make my own implementation of oauth2-server for my current project though)

Hi, is there something new in support ODM please? thanks

etshy commented 1 year ago

Hi. No sorry I put the project I planned to make a oauthserver for on hold so I didn't do anything about it yet.

etshy commented 1 year ago

I quickly took a look at this tonight and as a complete newbie with Bundle, I'm a bit lost. Should I add both ORM and ODM compilerPass or should I move that to the prepend to be able to load only one base on the Configuration ? I made some few tests but adding CompilerPass in the prepend doesn't seem to be working at all though.

So I guess I should load both and in the configureDoctrinePersistence I replace argument by entityManager or documentManager depending on the Configuration.

Another thing, Should I rework the Driver to replace it by files Mapping (XML ?) ? I saw in the DoctrineOrmMappingsPass that "You should not directly instantiate this class but use one of the factory methods."