Details
Description
Background of the issue.
Dependency of AtlasAuthenticationProvider is Injected in two place from constructor with @Inject 1) AtlasKnoxSSOFilter and AtlasSecurityConfig.
After observing the hashCode of objects of the AtlasAuthenticationProvider appeared to be same in respectively classes.
If no scope is specified single instance per container is created and thats caused the bug described below.
The ssoEnabled is a property in AtlasAuthenticationProvider which set from AtlasKnoxSSOFilter flow. Since the object reference were same, once the ssoEnabled is set true, it apply for LdapAuthentication flow also and the ldap authentication flow is goes in sso block
To fix the issue added scope prototype to AtlasAuthenticationProvider , so that different objects are create in AtlasKnoxSSOFilter and AtlasSecurityConfig respectively.