pwm icon indicating copy to clipboard operation
pwm copied to clipboard

Additional Configuration Parameter for OIDC with Auth0, fix for AD-Schema Import in AD

Open fbuchmeier-abi opened this issue 4 years ago • 0 comments

Hi,

you can find the following changes in this PR:

(1) I've added a new configuration parameter in the OIDC config HttpMethod that can be set to POST (default) and GET for the UserInfo endpoint.

This is because some OIDC providers like Auth0 require a GET request instead of a POST request to obtain data from the userinfo endpoint (see the User Profile API Doc for more details).

(2) To make OIDC logins work with the refactoring in 2.1.0 branch again, I've also had to update the PwmResponse.java to again work with external redirects. As far as I understand, in 2.0.0 all calls to the redirect response method were made with the baseUrl already added to the redirect target. Now, the baseUrl is conditionally added inside the method, which breaks external redirects like the ones to an OIDC sign in URL. The result in this case was /pwmhttps://login.auth0... which will obviously not work. In addition to checking for the presence of the baseUrl, i've also added a check to see it the redirect includes a protocol (http:// or https://) and in this case, skip adding the baseUrl in front of the redirect target.

Also, the settings lookup in the OIDC auth had to be updated to getAppConfig instead of getDomainConfig, otherwise it will fail with the following error:

java.lang.IllegalStateException: attempt to read system scope setting 'Domains ⇨ Site URL' as domain scope
        at password.pwm.config.StoredSettingReader.readSetting(StoredSettingReader.java:309)
        at password.pwm.config.StoredSettingReader.readSettingAsString(StoredSettingReader.java:100)
        at password.pwm.config.DomainConfig.readSettingAsString(DomainConfig.java:153)

(3) In addition to this, I've updated the provided AD-schema.ldif example to actually work with Microsoft Active Directory. As far as my tests went, AD fails with a schema validation as long as the leading whitespaces after dn: are present.

Please let me know if you have any questions or feedback I should include in the PR.

Best Regards, Florian.

fbuchmeier-abi avatar Oct 01 '21 07:10 fbuchmeier-abi