Quantcast
Channel: Spring Community Forums - Social
Viewing all articles
Browse latest Browse all 145

Strange behavior in SignInInterceptor

$
0
0
In my config class I define my Interceptor in the usual way:

Code:

@Bean
public ProviderSignInController providerSignInController(RequestCache requestCache) {
    ProviderSignInController signInController = new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository,
            new MySignInAdapter(requestCache, userRepository, userAliasRepository));
    signInController.addSignInInterceptor(new MyProviderSignInInterceptor());
    return signInController;
}

where my interceptor is defined this way:

Code:

public class MyProviderSignInInterceptor implements ProviderSignInInterceptor<Facebook> { .. }
And everything works as expected.

What I find strange is that if the interceptor class is defined using generics in this way:
Code:

public class MyProviderSignInInterceptor<T> implements ProviderSignInInterceptor<T> { .. }
and instantiated with Facebook this way:

Code:

@Bean
public ProviderSignInController providerSignInController(RequestCache requestCache) {
    ProviderSignInController signInController = new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository,
            new MySignInAdapter(requestCache, userRepository, userAliasRepository));
    signInController.addSignInInterceptor(new MyProviderSignInInterceptor<Facebook>());
    return signInController;
}

then the interceptor methods are not called.

Is that normal, and if yes, why? I could not get it :(

Viewing all articles
Browse latest Browse all 145

Trending Articles