r3h6 / TYPO3.EXT.oidc_server

GNU General Public License v2.0
0 stars 1 forks source link

Missing client specific scope (grants) in UserinfoController #2

Open typoworx-de opened 2 years ago

typoworx-de commented 2 years ago

Great work and thanks for sharing these great oauth with the community.

I'm struggling with a problem and I'm not shure if this is configuration specific issue or a bug. I got oAuth & Authentification agains frontend-user working.

Doing the call to /oauth2/userinfo works as well, but it gives me only {"sub": 10} (FE-User uid). In the client record I configured the following allowed_scopes: profile, email, openid.

So I would expect these scope/grants are respected. But for some reason the $scopes in UserinfoController are an empty array missing all the grants from client-record.

Is this a bug in UserinfoController or a misconfiguration?

r3h6 commented 2 years ago

As far as I know the underlying library respects the scopes submitted in the token. These scopes must be requested already in very beginning of the authorization flow. At least in my local setup the endpoint returns the data from the fe_user.

Maybe enable debug logs gives you a better insight:

$GLOBALS['TYPO3_CONF_VARS']['LOG']['R3H6']['Oauth2Server']['writerConfiguration'] = [
    \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
        \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
            // 'logFile' => 'typo3temp/logs/oidc.log'
        ],
    ],
];

$GLOBALS['TYPO3_CONF_VARS']['LOG']['R3H6']['OidcServer']['writerConfiguration'] = [
    \TYPO3\CMS\Core\Log\LogLevel::DEBUG => [
        \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [
            // 'logFile' => 'typo3temp/logs/oidc.log'
        ],
    ],
];