jsr375-experts@javaee-security-spec.java.net

[jsr375-experts] Custom IdentityStoreHandler issues

From: Rudy De Busscher <rdebusscher_at_gmail.com>
Date: Tue, 1 Nov 2016 22:09:16 +0100

Hi All,

For a presentation, I was preparing a demo with a custom
IdentityStoreHandler.

But since the DefaultIdentityStoreHandler is registered as CDI bean within
the CdiExtension , there is an issue when we want to make a custom version
of it.

*Using @Specializes fails*

Because the extended class isn't marked as CDI bean.

*WELD-000047: Specializing bean must extend another bean: Managed Bean
[class be.c4j.security.CustomIdentityStoreHandler] with qualifiers [@Any
@Default]"}*

*It can't be just marked as CDI bean (@ApplicationScoped, ...)*

Because then there is an ambiguous definition (the default and the Custom
version)


*WELD-001409: Ambiguous dependencies for type IdentityStoreHandler with
qualifiers @Default*

So we should review the usage and definition of the IdentityStoreHandler so
that custom implementations are possible.

As I remember correctly, the usage of a CDI Extension to register beans, is
required when Soteria (or any framework using CDI) is defined as 'module'
on the server because these aren't scanned.

Best regards
Rudy