LDAP settings for SAML AD SSO and environment variable?

Trying to fix LDAP settings for AD SSO using kerberos in apache and using environment variable in the SAML app.

I have read this https://github.com/nextcloud/user_saml/issues/118 and is now wondering which LDAP settings I should use for SSO in the LDAP app?

Added the fix about lower case in the SAML app

Current LDAP query for login attribute:
(&(&(|(objectclass=person))(|(|(memberof=CN=NextCloud,OU=myOu,DC=my,DC=domain,DC=local))))(samaccountname=%uid))

Under Expert tab I shall change Internal Username Attribute from samaccountname to %uid?