0

I'm facing an issue in socialAuth java library. I used that library for logging to my app by using social networks. Login with Facebook is working properly. But when i try to use google and yahoo is does not work for me. Error occur when after authentication process, redirection part is not working properly,

@SuppressWarnings("unused")
@RequestMapping(params = "code")
private String oauth2Callback(final HttpServletRequest request,
                              HttpServletResponse response,
                              Model model) throws Exception {
    String serviceReturnUrl = request.getParameter("service");
    String clientAppKey = request.getParameter("app_key");
    org.brickred.socialauth.AuthProvider provider = null;
    SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
    if (manager != null) {
        try {
            provider = manager.connect(SocialAuthUtil.getRequestParametersMap(request));
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        response.sendRedirect(appLoadConfigurer.getProperty("caslk"));
        return "";
    }

When redirecting Facebook to my app this method catch the request. but when it comes to google, i could not catch the request from google by using this method. request is not comes to here. Any one can idea to fix my issue as soon as possible

Amila
  • 243
  • 1
  • 10
  • 24

1 Answers1

0

For google you will have to use

@RequestMapping(params = "openid.claimed_id")

Because google doen't return any attribute with name 'code' that's why it is not matching with this.

Tarun Nagpal
  • 964
  • 1
  • 9
  • 25