Spring boot Oauth2 Вход в Facebook - ошибка разбора JSON: Невозможно десериализовать экземпляр `java.lang.String` из маркера START_OBJECT - PullRequest
1 голос
/ 03 июня 2019

Я работал с логином Spring boot OAuth2 на Facebook, но столкнулся с ошибкой разбора JSON: невозможно десериализовать экземпляр java.lang.String из токена START_OBJECT. Тот же код работает для Google и логин работает, как и ожидалось. Я следую этому коду на Github (https://github.com/callicoder/spring-boot-react-oauth2-social-login-demo). Не могли бы вы мне помочь решить эту проблему?

Ниже приведены сведения о SecurityConfig


    @Override
        protected void configure(HttpSecurity http) throws Exception {
            http
                    .cors()
                    .and()
                    .sessionManagement()
                    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and()
                    .csrf()
                    .disable()
                    .formLogin()
                    .disable()
                    .httpBasic()
                    .disable()
                    .exceptionHandling()
                    .authenticationEntryPoint(new RestAuthenticationEntryPoint())
                    .and()
                    .authorizeRequests()
                    .antMatchers("/","/public/**",
                            "/login",
                            "/register",
                            "/error",
                            "/favicon.ico",
                            "/**/*.png",
                            "/**/*.gif",
                            "/**/*.svg",
                            "/**/*.jpg",
                            "/**/*.html",
                            "/fonts/*.*",
                            "/webfonts/*.*",
                            "/**/*.css",
                            "/**/*.js")
                    .permitAll()
                    .antMatchers("/auth/**", "/oauth2/**")
                    .permitAll()
                    .anyRequest()
                    .authenticated()
                    .and()
                    .oauth2Login()
                    .authorizationEndpoint()
                    .baseUri("/oauth2/authorize")        
                    .authorizationRequestRepository 
                                (cookieAuthorizationRequestRepository())
                    .and()
                    .redirectionEndpoint()
                    .baseUri("/oauth2/callback/*")
                    .and()
                    .userInfoEndpoint()
                    .userService(customOAuth2UserService)
                    .and()
                    .successHandler(oAuth2AuthenticationSuccessHandler)
                    .failureHandler(oAuth2AuthenticationFailureHandler);

            // Add our custom Token based authentication filter
            http.addFilterBefore(tokenAuthenticationFilter(), 
                      UsernamePasswordAuthenticationFilter.class);
        }

Facebook успешно аутентифицирует логин, но когда он вызывает мои приложения, появляется эта ошибка.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...