cas-pac4j-oauth-client-demo random errors when login through Twitter, facebook

263 views
Skip to first unread message

Sashika

unread,
Jan 9, 2014, 12:44:23 AM1/9/14
to jasig-c...@googlegroups.com
I merged the configurations in cas-pac4j-oauth-server-demo into cas-pac4j-oauth-client-demo (4.0.0.0 RC2) so that the cas-pac4j-oauth-client-demo will act as a oauth server for my client apps. When I issue http://localhost:8080/cas/oauth2.0/authorize?redirect_uri=http://www.someservice&client_id=this_is_the_key the CAS server will display the login screen. At this point if I enter username=password the user is redirected to the service url and no issues with that. But if I log in through facebook or twitter CAS server will give errors like the following

2014-01-09 11:00:47.514:WARN:oejs.ServletHandler:/cas/login
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.jasig.cas.support.pac4j.web.flow.ClientAction@61b96b in state 'clientAction' of flow 'login' -- action execution attributes were 'map[[empty]]'

Caused by:
org.pac4j.core.exception.TechnicalException: org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
        at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:166)

Caused by:
org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
        at org.scribe.model.ProxyRequest.send(ProxyRequest.java:85)

Caused by:
java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)


The error is totally random, for facebook, sometimes it succeeds and sometimes not. For twitter it will happen 99% of the time. I have no connectivity issues with facebook or twitter. Infact the CAS server is throwing these errors as soon as I click the login links. It does not even wait till a timeout occurs.

Jérôme LELEU

unread,
Jan 10, 2014, 1:20:01 AM1/10/14
to cas-...@lists.jasig.org
Hi,

The "connect time out" is a pretty straight network error.

Do you have any internal proxy required to reach internet ? Did you check you connectivity from your server to Facebook for example (doing a curl on your server) ?

Best regards,
Jérôme
-- 
You are currently subscribed to cas-...@lists.jasig.org as: cas-user-ga...@googlegroups.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Sashika

unread,
Jan 10, 2014, 1:23:51 AM1/10/14
to jasig-c...@googlegroups.com
Hi Thanks for the reply. I really appreciate it. 
No I do not have a proxy at the moment and I do not have any problems accessing the social networks over the web. But anyway I will do a curl and see if there is an issue with the connectivity.

Thanks.


-- 
You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user


--
You received this message because you are subscribed to a topic in the Google Groups "jasig-cas-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jasig-cas-user/rY31P7NdgdU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jasig-cas-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sashika

unread,
Jan 10, 2014, 1:53:36 AM1/10/14
to jasig-c...@googlegroups.com
Yes you are right. Though I did not see any errors in the curl request, after further investigation found out that the router is faulty and causing connection timeouts. After the restart of the router the thing works fine. Thanks for the great software.

Subash Singh

unread,
Sep 16, 2014, 9:01:10 AM9/16/14
to jasig-c...@googlegroups.com, cas-...@lists.jasig.org

HI Jérôme LELEU ,

I'm currently building an app which will use pac4j-oauth to login to facebook, google, twitter and linkedin with j2e-pac4j Framework 1.03. 
I've also configured it according to the read-me published in the git repo for the oauth module. 
All logins are working fine except linkedin. When i am trying to do oauth login through linkedin, some time i am getting some error (frequency of failure is 4/10). 
As per your above feedback, If network related issue will be there then my code should fail all time but it is failing some time.
Exception stacktrace are given below -

org.pac4j.core.exception.TechnicalException: org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
        at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:169)
        at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:45)
        at org.pac4j.core.client.BaseClient.getUserProfile(BaseClient.java:231)
        at com.altiux.iotee.ioteede.usermanagement.CommonCallBack.doGet(CommonCallBack.java:185)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:439)
        at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2442)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2431)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
        at org.scribe.model.ProxyRequest.send(ProxyRequest.java:85)
        at org.scribe.model.ProxyOAuthRequest.send(ProxyOAuthRequest.java:49)
        at org.pac4j.oauth.client.BaseOAuthClient.sendRequestForData(BaseOAuthClient.java:238)
        at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfileFromToken(BaseOAuthClient.java:204)
        at org.pac4j.oauth.client.BaseOAuthClient.retrieveUserProfile(BaseOAuthClient.java:167)
        ... 30 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
        at sun.security.ssl.InputRecord.read(InputRecord.java:480)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
        at org.scribe.model.Response.<init>(Response.java:29)
        at org.scribe.model.ProxyRequest.doSend(ProxyRequest.java:125)



Would you mind giving me some help to get into the right path for solving this?


Thanks for your help,

Subash Singh
Reply all
Reply to author
Forward
0 new messages