Spring social - Facebook cant authenticate -
i trying implement spring social signin facebook or other social network.
i doing wrong, dont know it.
when request facebook in log see 200 (ok)
cant logged user.
i logs see:
first see facebook returning user:
2014-11-19t14:18:48.156+0100|info: http-outgoing-1 << "{"id":"***","first_name":"***","gender":"male","last_name":"***","link":"https:\/\/www.facebook.com\/app_scoped_user_id\/***\/","locale":"es_es","name":"***","timezone":2,"updated_time":"2014-03-20t21:50:00+0000","verified":true}"
but after request see:
2014-11-19t14:18:48.164+0100|info: request "https://graph.facebook.com/me" resulted in 200 (ok) 2014-11-19t14:18:48.165+0100|info: reading [class org.springframework.social.facebook.api.facebookprofile] "application/json" using [org.springframework.http.converter.json.mappingjackson2httpmessageconverter@3ee8e5cb] 2014-11-19t14:18:48.165+0100|info: connection [id: 1][route: {s}->https://graph.facebook.com:443] can kept alive indefinitely 2014-11-19t14:18:48.165+0100|info: connection released: [id: 1][route: {s}->https://graph.facebook.com:443][total kept alive: 1; route allocated: 1 of 5; total allocated: 1 of 10] 2014-11-19t14:18:48.198+0100|info: authentication attempt using org.springframework.social.security.socialauthenticationprovider 2014-11-19t14:18:48.220+0100|info: executing prepared sql query 2014-11-19t14:18:48.223+0100|info: executing prepared sql statement [select userid userconnection providerid = ? , provideruserid = ?] 2014-11-19t14:18:48.243+0100|info: fetching jdbc connection datasource 2014-11-19t14:18:48.288+0100|info: returning jdbc connection datasource 2014-11-19t14:18:48.298+0100|info: authentication request failed: org.springframework.social.security.socialauthenticationredirectexception: 2014-11-19t14:18:48.299+0100|info: updated securitycontextholder contain null authentication 2014-11-19t14:18:48.299+0100|info: delegating authentication failure handler org.springframework.social.security.socialauthenticationfailurehandler@20cc9603 2014-11-19t14:18:48.299+0100|info: securitycontext empty or contents anonymous - context not stored in httpsession. 2014-11-19t14:18:48.300+0100|info: securitycontextholder cleared, request processing completed
when in database in table "userconnection" don't see user.
also when try principal user anonymous.
i dont know error or class need modify or create. can put code.
thanks in advance. stel.
are using springsocialconfigurer? calling "/auth/{provider}"?
my guess have following issue:
you signed in via facebook,
- you not have existing userconnection existing local user
- you not have local user , need establish connection provider
you can few things test
- try signup approach using providersignincontroller or
- try set implicit signin / signup. create new local user if non found.
see tutorial
Comments
Post a Comment