FriendsOfSymfony / FOSOAuthServerBundle

A server side OAuth2 Bundle for Symfony
1.09k stars 450 forks source link

Problem with MongoDB configuration (authentication) #443

Open qweluke opened 7 years ago

qweluke commented 7 years ago

Hi,

I am trying to use FOSOAuthServerBundle with MongoDB -> my repo

I have a problem with authentication. To be more precisious

if I try to get current logged user with $this->getUser() it returns null I noticed that in AccessToken document user is missing

image while the same table (but in MySQL) contains this information and $this->getUser() returns user object. image

I would notice that first I have configured this repo to use MySQL as the database, next I have changed doctrine orm to odm so I could use MongoDB but after changing to Mongo I have a problem like above.

Have I missed something in the configuration?

luchianenco commented 7 years ago

as you stated, the problem should be in Documents. There is no defined property $user in AccessToken, AuthCode, RefreshToken Documents