Quantcast
Viewing all articles
Browse latest Browse all 145

Reconnectfilter: Authentication always null

Hi,

I'm playing around with the ReconnectFilter.

PHP Code:

        @Bean
    
public UserIdSource userIdSource() {
        return new 
UserIdSource() {            
            @
Override
            
public String getUserId() {
                
Authentication authentication SecurityContextHolder.getContext().getAuthentication();
                if (
authentication == null) {
                    throw new 
IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
                }
                return 
authentication.getName();
            }
        };
    } 

The scenario is as follows:
* I create a connection (using Google)
* I go to Google and remove the authorization for my app
* I try to connect again using the existing connection that still exists on my side but is now invalid

In this scenario, an ExpiredAuthorizationException is thrown, the authentication is always null (even though there is a logged in user). Any idea why?

Kind regards,
Marc

Viewing all articles
Browse latest Browse all 145

Trending Articles