marketing-factory / oauth2

Generic OAuth2 authentication and authorization for TYPO3 CMS
Other
9 stars 18 forks source link

Broken login functionality in TYPO3 11 LTS #31

Closed tobibuenter closed 2 years ago

tobibuenter commented 2 years ago

We created a small extension with just the following ext_localconf.php content

\Mfc\OAuth2\ResourceServer\Registry::addServer(
        'gitlab',
        'Login mit GitLab',
        \Mfc\OAuth2\ResourceServer\GitLab::class,
        [
            'enabled'   => true,
            'arguments' => [
                'appId'                => $extensionConfiguration['appId'],
                'appSecret'            => $extensionConfiguration['appSecret'],
                'gitlabServer'         => 'OUR-OWN-GITLAB-SERVER',
                'gitlabAdminUserLevel' => \Mfc\OAuth2\ResourceServer\GitLab::USER_LEVEL_MAINTAINER,
                'gitlabDefaultGroups'  => $extensionConfiguration['defaultGroups'],
                'gitlabUserOption'     => 3,
                'blockExternalUser'    => true,
                'projectName'          => 'PROJECT-NAME',
            ],
        ]
    );

I debugged the 3 used variables, all contains the right values.

[BE][cookieSameSite] is set to "lax"

I also set this information in our gitlab instance.

When creating the application within GitLab, you might need the following information:
- Redirect URI: `<your-domain-here>/typo3/index.php`
- Scopes: `api`,`read_user`,`openid`

Login startscreen works like expected in TYPO3 11.

Bildschirmfoto 2022-01-17 um 08 20 49

If I switch to “login with OAuth”, the login form looks pretty wrong.

Bildschirmfoto 2022-01-17 um 08 20 58

If I just hit the "Anmeldung"-button, there is no redirect to gitlab, nothing. The login-screen just get reloaded. Tested in several browsers on the latest Mac OS.

In TYPO3 10 all works pretty fine with the same little extension.

Environment:

zenobio93 commented 2 years ago

Should be fixed now within #30 and published as new version 3.0.1

tobibuenter commented 2 years ago

GREAT! Thank you very much for your very fast fix!!