FriendsOfSymfony / FOSOAuthServerBundle

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

Errors found when auto_mapping is disabled and I didn't heed the instructions about mappings #695

Open zyphlar opened 2 years ago

zyphlar commented 2 years ago

Just for posterity since I thought I was going crazy:

If you get errors like

Unrecognized field: randomId

for your /oauth/v2/auth page, or perhaps

{"error":"redirect_uri_mismatch","error_description":"The redirect URI provided does not match registered URI(s)."}

when you get past that error, the problem is that FOSOAuthServerBundle needs to be in the Doctrine mappings so that base model attributes are added to the database. (Obviously any database migrations also need to be created or applied as well so this data can be persisted.)

config.yml:

doctrine:
    orm:
        entity_managers:
            default:
                mappings:
                    FOSOAuthServerBundle: ~

Once again, reading the instructions pays off :)