UaaLocalUserManager Postconstruct dont use beans from App Configuration Class

Hello everyone,

As described in the ‘Custom Attributes for Local User Link’ documentation, we have added some properties to the class and placed the bean in our application configuration.

    @Bean
    @ConditionalOnAuthentication(AuthenticationType.LOCAL)
    public LocalUserLoader<CustomLocalUser> userLoader() {
        return new UAALocalUserLoader<>(CustomLocalUser.class);
    }

However, the ‘UAALocalUserManager’ class does not access it, but uses your internal ‘Localuser’ class instead. That’s only the case if the bean doesn’t exist. However, if I place the bean in the app class, it is used. I suspect that this is due to your ‘PostConstruct’ annotation, as our configuration is not yet in place. Do you have any idea where I should put it so that it is used?

Unfortunately, your documentation is no longer up to date.

hello @anon55280409

Our default bean only initialized in case you don’t provide any bean in your configuration.
Therefore, based on your post, providing that custom bean is correct.

The main problem here is your custom bean is not picked up correctly by Spring. We had our test application with this feature exactly the same as you provided in your post and we can’t reproduce the problem.

Probably a call in details with our A12 TPS would help in this case.
You mentioned “your documentation í no longer up to date” could you mention more specifically what is out dated ?

Hello @tuan-stable-gale,

thank you very much for your quick reply. I checked it again with the template and you were right. We found out that the annotation ‘@DataServicesApplication’ is the problem. We had to add our own package. Unfortunately this was not in the documentation.

@DataServicesApplication(scanBasePackages = {
        "com.company.mypackage",
        "com.mgmtp.a12.dataservices"
})

In this part of the documentation, the following line of code is out of date.

Know

@Bean
@ConditionalOnAuthentication(AuthenticationType.LOCAL)
public LocalUserLoader<ExampleLocalUser> userLoader() {
    return new LocalUserLoader<ExampleLocalUser>(ExampleLocalUser.class);
}

but must

@Bean
@ConditionalOnAuthentication(AuthenticationType.LOCAL)
public LocalUserLoader<ExampleLocalUser> userLoader() {
    return new UAALocalUserLoader<ExampleLocalUser>(ExampleLocalUser.class);
}

Greetings