[cas-user] Getting "Response body is incorrect" exception randomly while trying to login with CAS with facebook, Google Plus login

292 views
Skip to first unread message

Rohit Kotecha

unread,
Aug 29, 2013, 7:02:12 PM8/29/13
to cas-...@lists.jasig.org

Hi Team,

 

2013-08-30 04:22:13,898 ERROR [org.jasig.cas.authentication.AuthenticationManagerImpl] - org.jasig.cas.support.oauth.authentication.handler.support.OAuthAuthenticationHandler threw error authenticating org.jasig.cas.support.oauth.authentication.principal.OAuthCredentials@22ebc6bf

org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract a token from this: '{"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}}'

        at org.scribe.extractors.TokenExtractor20Impl.extract(TokenExtractor20Impl.java:33)

        at org.scribe.up.addon_to_scribe.ProxyOAuth20ServiceImpl.getAccessToken(ProxyOAuth20ServiceImpl.java:63)

        at org.scribe.up.provider.BaseOAuth20Provider.getAccessToken(BaseOAuth20Provider.java:54)

        at org.scribe.up.provider.BaseOAuthProvider.getUserProfile(BaseOAuthProvider.java:122)

        at org.jasig.cas.support.oauth.authentication.handler.support.OAuthAuthenticationHandler.doAuthentication(OAuthAuthenticationHandler.java:66)

        at org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate_aroundBody2(AbstractPreAndPostProcessingAuthenticationHandler.java:85)

        at org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate_aroundBody3$advice(AbstractPreAndPostProcessingAuthenticationHandler.java:57)

        at org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate(AbstractPreAndPostProcessingAuthenticationHandler.java:1)

        at org.jasig.cas.authentication.AuthenticationManagerImpl.authenticateAndObtainPrincipal(AuthenticationManagerImpl.java:93)

        at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody0(AbstractAuthenticationManager.java:57)

        at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody1$advice(AbstractAuthenticationManager.java:57)

        at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:1)

        at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

        at com.github.inspektr.audit.AuditTrailManagementAspect.handleAuditTrail(AuditTrailManagementAspect.java:126)

        at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

        at org.perf4j.aop.AbstractTimingAspect$1.proceed(AbstractTimingAspect.java:47)

        at org.perf4j.aop.AgnosticTimingAspect.runProfiledMethod(AgnosticTimingAspect.java:53)

        at org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:45)

        at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

        at $Proxy42.authenticate(Unknown Source)

        at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket_aroundBody10(CentralAuthenticationServiceImpl.java:477)

        at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket_aroundBody11$advice(CentralAuthenticationServiceImpl.java:57)

        at org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:1)

        at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

        at com.github.inspektr.audit.AuditTrailManagementAspect.handleAuditTrail(AuditTrailManagementAspect.java:126)

        at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

        at org.perf4j.aop.AbstractTimingAspect$1.proceed(AbstractTimingAspect.java:47)

        at org.perf4j.aop.AgnosticTimingAspect.runProfiledMethod(AgnosticTimingAspect.java:53)

        at org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:45)

        at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

        at $Proxy43.createTicketGrantingTicket(Unknown Source)

        at org.jasig.cas.support.oauth.web.flow.OAuthAction.doExecute(OAuthAction.java:102)

        at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)

        at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)

        at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77)

        at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)

        at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)

        at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)

        at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101)

        at org.springframework.webflow.engine.State.enter(State.java:194)

        at org.springframework.webflow.engine.Flow.start(Flow.java:535)

        at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:366)

        at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:225)

        at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140)

        at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)

        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)

        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)

        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

        at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128)

        at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57)

        at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)

        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

        at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)

        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)

        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)

        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)

        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)

        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)

        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)

        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)

        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)

        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)

        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)

        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)

        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)

        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)

        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)

        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)

        at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:382)

        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)

        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

2013-08-30 04:22:13,902 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - Audit trail record BEGIN

 

Thanks and Regards,

Rohit Kotecha

-- 
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
-**************Nihilent***************
" *** All information contained in this communication is confidential, proprietary, privileged
and is intended for the addressees only. If youhave received this E-mail in error please notify
mail administrator by telephone on +91-20-39846100 or E-mail the sender by replying to
this message, and then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination,publication, transfer or use of the contents of this communication,
with or without modifications is punishable under the relevant law.

Nihilent has scanned this mail with current virus checking technologies. However, Nihilent makes no 
representations or warranties to the effect that this communication is virus-free.

Nihilent reserves the right to monitor all E-mail communications through its Corporate Network. *** "

*************************************************************************-

Jérôme LELEU

unread,
Aug 30, 2013, 3:45:22 AM8/30/13
to cas-...@lists.jasig.org
Hi,

The error is fairly explicit : you are trying to re-use the same OAuth authorization code twice. The code is returned by the provider (Facebook, Google) after a successful authentication, to be exchanged for an access token.
The root cause might be a lot more complicated to find. Hard to guess a scenario behind.

You seems to have a lot of problems with OAuth support. One question that pops up in my mind : do you have a cluster of CAS servers ?

Best regards,
Jérôme



2013/8/30 Rohit Kotecha <rohit....@nihilent.com>
-- 
You are currently subscribed to cas-...@lists.jasig.org as: lel...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
-**************Nihilent***************
" *** All information contained in this communication is confidential, proprietary, privileged
and is intended for the addressees only. If youhave received this E-mail in error please notify
mail administrator by telephone on +91-20-39846100 or E-mail the sender by replying to
this message, and then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination,publication, transfer or use of the contents of this communication,
with or without modifications is punishable under the relevant law.

Nihilent has scanned this mail with current virus checking technologies. However, Nihilent makes no 
representations or warranties to the effect that this communication is virus-free.

Nihilent reserves the right to monitor all E-mail communications through its Corporate Network. *** "

*************************************************************************-

Rohit Kotecha

unread,
Aug 30, 2013, 7:16:38 AM8/30/13
to cas-...@lists.jasig.org

Thanks for rpely.

 

You are true.  I am facing lot of problems with OAuth support.

 

we don’t have cluster of CAS servers. we have just one CAS server.

 

Regards,

Rohit Kotecha

-- 
You are currently subscribed to cas-...@lists.jasig.org as: rohit....@nihilent.com

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

-- 

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

Jérôme LELEU

unread,
Aug 30, 2013, 8:08:17 AM8/30/13
to cas-...@lists.jasig.org
Hi,

You are suffering a lot of problems, that's not normal ! I'm willing to investigate, but firstly I would need a record of all HTTP requests with cookies to see if everything is ok for the web sessions.
Best regards,
Jérôme

Rohit Kotecha

unread,
Sep 3, 2013, 3:34:10 AM9/3/13
to cas-...@lists.jasig.org

Hi,

 

Thanks for reply.

 

 

Below is the first request header after user submits credential to the facebook.

This request response I got using httpfox tool in firefox browser.

 

Also I am attaching screenshot if it helps.

 

Request 1:

 

(Request-Line) POST /login.php?login_attempt=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DjRRdDS8SME%26scope%3Demail%26client_id%3D144902749050404%26ret%3Dlogin HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=144902749050404&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DjRRdDS8SME%26scope%3Demail%26client_id%3D144902749050404%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DjRRdDS8SME%23_%3D_&display=page

Cookie  datr=8Y4lUvK74gKRiKwuJieOknMR; reg_ext_ref=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Fservice%3Dhttp%253A%252F%252Fwww.tumbhi.com%252Fj_spring_cas_security_check; reg_fb_gate=https%3A%2F%2Fwww.facebook.com%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D144902749050404%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.tumbhi.com%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DjRRdDS8SME%2526scope%253Demail%2526client_id%253D144902749050404%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DjRRdDS8SME%2523_%253D_%26display%3Dpage; reg_fb_ref=https%3A%2F%2Fwww.facebook.com%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D144902749050404%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.tumbhi.com%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DjRRdDS8SME%2526scope%253Demail%2526client_id%253D144902749050404%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DjRRdDS8SME%2523_%253D_%26display%3Dpage; wd=1280x389; act=1378193106320%2F1; _e_0BFI_0=%5B%220BFI%22%2C1378193099581%2C%22act%22%2C1378193099578%2C0%2C%22email%22%2C%22click%22%2C%22click%22%2C%22-%22%2C%22r%22%2C%22%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D144902749050404%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.tumbhi.com%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DjRRdDS8SME%2526scope%253Demail%2526client_id%253D144902749050404%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DjRRdDS8SME%2523_%253D_%26display%3Dpage%22%2C%7B%22ft%22%3A%7B%7D%2C%22gt%22%3A%7B%7D%7D%2C0%2C0%2C0%2C981%2C16%5D; _e_0BFI_1=%5B%220BFI%22%2C1378193106323%2C%22act%22%2C1378193106320%2C1%2C%22login%22%2C%22click%22%2C%22click%22%2C%22-%22%2C%22r%22%2C%22%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D144902749050404%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.tumbhi.com%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DjRRdDS8SME%2526scope%253Demail%2526client_id%253D144902749050404%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DjRRdDS8SME%2523_%253D_%26display%3Dpage%22%2C%7B%22ft%22%3A%7B%7D%2C%22gt%22%3A%7B%7D%7D%2C0%2C0%2C0%2C981%2C16%5D

Connection         keep-alive

Content-Type    application/x-www-form-urlencoded

Content-Length                522

 

Response 1:

 

(Status-Line)      HTTP/1.1 302 OK

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Tue, 03 Sep 2013 07:25:54 GMT

Location               https://www.facebook.com/dialog/oauth?redirect_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=jRRdDS8SME&scope=email&client_id=144902749050404&ret=login&ext=1378196754&hash=AeYTx9KKRZkB0EcY

P3P        CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p"

Set-Cookie          act=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          c_user=100006251472506; path=/; domain=.facebook.com; secure

Set-Cookie          csm=2; path=/; domain=.facebook.com

Set-Cookie          datr=8Y4lUvK74gKRiKwuJieOknMR; expires=Thu, 03-Sep-2015 07:25:54 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          fr=0hn1DCnZJuRdvsRmB.AWXHmIvMhQM6ohJS5JXvS0jSf_8.BSJY8C.G4.AAA.AWUSVVsh; expires=Thu, 03-Oct-2013 07:25:54 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          lu=Rglb_DrzxkY13iMzWsLU4rog; expires=Thu, 03-Sep-2015 07:25:54 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          reg_ext_ref=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          reg_fb_gate=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          reg_fb_ref=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          s=Aa50S2b_euHBq6xH.BSJY8C; path=/; domain=.facebook.com; secure; httponly

Set-Cookie          wd=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          xs=66%3ANNIRdmcGOLUAEw%3A2%3A1378193154%3A2031; path=/; domain=.facebook.com; secure; httponly

Set-Cookie          _e_0BFI_1=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          _e_0BFI_0=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

X-Content-Type-Options              nosniff

X-FB-Debug        td4ixJEG1ARz+v/aUYOqyl2X+SIjo+JnNz2L69OrM48=

X-Firefox-Spdy  2

 

Request 2:

 

(Request-Line)  GET /dialog/oauth?redirect_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=jRRdDS8SME&scope=email&client_id=144902749050404&ret=login&ext=1378196754&hash=AeYTx9KKRZkB0EcY HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=144902749050404&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DjRRdDS8SME%26scope%3Demail%26client_id%3D144902749050404%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DjRRdDS8SME%23_%3D_&display=page

Cookie  datr=8Y4lUvK74gKRiKwuJieOknMR; c_user=100006251472506; csm=2; fr=0hn1DCnZJuRdvsRmB.AWXHmIvMhQM6ohJS5JXvS0jSf_8.BSJY8C.G4.AAA.AWUSVVsh; lu=Rglb_DrzxkY13iMzWsLU4rog; s=Aa50S2b_euHBq6xH.BSJY8C; xs=66%3ANNIRdmcGOLUAEw%3A2%3A1378193154%3A2031

Connection         keep-alive

 

Response header 2:

 

(Status-Line)      HTTP/1.1 302 OK

Cache-Control   private, no-cache, no-store, must-revalidate

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Tue, 03 Sep 2013 07:25:55 GMT

Expires Sat, 01 Jan 2000 00:00:00 GMT

Location               http://login.tumbhi.com/oauth/login?oauth_provider=FacebookProvider&code=AQC-Zkbcg98Vo4lp_58eR74UvDFnrT5Z5qE3IpRj3xxn7IgfXSOeom0QCFkve6Lb4KJtz_djrIIL7gng7BElYHYYQhrv4uEdkHU2AkM5S_HPZDgjaclIt6RwPQi2ONinggL8SlvIGbje_4cnd7dgNx4smSJP_UztNHhy2HkbWY3xEA72x8MhrWrVqWQLAN2H9H-WZP-CFXr5gPtLg47HHuxfgqYkgYncu9nQVLUJY_DV6kHH0WxJTglbET2DvC-nlzIEx3i95Lkj14ZXiSfNF7Nqiqk7dImKj044qhq8voVS_EK3a--I0_arXmD4x4izWeY&state=jRRdDS8SME#_=_

Pragma no-cache

X-Content-Type-Options              nosniff

X-Frame-Options             DENY

X-XSS-Protection             0

X-FB-Debug        Wjb2tFrORf4kDTSVhmm8rtyOss7g8/EwqV1+nEIlGXA=

X-Firefox-Spdy  2

 

 

Request 3:

 

(Request-Line)  GET /oauth/login?oauth_provider=FacebookProvider&code=AQC-Zkbcg98Vo4lp_58eR74UvDFnrT5Z5qE3IpRj3xxn7IgfXSOeom0QCFkve6Lb4KJtz_djrIIL7gng7BElYHYYQhrv4uEdkHU2AkM5S_HPZDgjaclIt6RwPQi2ONinggL8SlvIGbje_4cnd7dgNx4smSJP_UztNHhy2HkbWY3xEA72x8MhrWrVqWQLAN2H9H-WZP-CFXr5gPtLg47HHuxfgqYkgYncu9nQVLUJY_DV6kHH0WxJTglbET2DvC-nlzIEx3i95Lkj14ZXiSfNF7Nqiqk7dImKj044qhq8voVS_EK3a--I0_arXmD4x4izWeY&state=jRRdDS8SME HTTP/1.1

Host       login.tumbhi.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Cookie  loginCalledFrom=tumbhi; JSESSIONID=2b563b8847e8e8d45b9f00706bca

 

Response header 3:

 

blank

 

Request 4:

(Request-Line)  GET /dialog/oauth?redirect_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=jRRdDS8SME&scope=email&client_id=144902749050404&ret=login HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=144902749050404&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.tumbhi.com%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DjRRdDS8SME%26scope%3Demail%26client_id%3D144902749050404%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.tumbhi.com%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DjRRdDS8SME%23_%3D_&display=page

Cookie  datr=8Y4lUvK74gKRiKwuJieOknMR; c_user=100006251472506; csm=2; fr=0hn1DCnZJuRdvsRmB.AWXHmIvMhQM6ohJS5JXvS0jSf_8.BSJY8C.G4.AAA.AWUSVVsh; lu=Rglb_DrzxkY13iMzWsLU4rog; s=Aa50S2b_euHBq6xH.BSJY8C; xs=66%3ANNIRdmcGOLUAEw%3A2%3A1378193154%3A2031

Connection         keep-alive

 

Response header 4:

 

(Status-Line)      HTTP/1.1 302 OK

Cache-Control   private, no-cache, no-store, must-revalidate

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Tue, 03 Sep 2013 07:25:56 GMT

Expires Sat, 01 Jan 2000 00:00:00 GMT

Location               http://login.tumbhi.com/oauth/login?oauth_provider=FacebookProvider&code=AQDnuTVWhpHlsydBsEWiOo8TYnSYjF6a0YVAFs9SIQj8CA2nXRTQEZVadzTcxdhe3RwCLKnXm1wbJMoTmGz8V6mJMZOOyZl6dNf2HfA5gTxana0RNZSlYXBkqHWVM7XqUOlKWrvRJey82WtbUKyacbEFx09q0VOb1edXTAgxFqFLx-m-FPXYFzxr9s-XvLwLnc6HcZ3rG8jDBOUtsYfX9IUnAWn0zRPdFxhs5UGNVxRIyOwkVcdbDWzWWy1CaB0LxWjA7VY2lyYbBdnjyjT13SGz5NB1xZKD_cShnsgMVZrgxJwEvWKmIFCmBQTUrysra5c&state=jRRdDS8SME#_=_

Pragma no-cache

X-Content-Type-Options              nosniff

X-Frame-Options             DENY

X-XSS-Protection             0

X-FB-Debug        iaXO1Sa2LFJ1sHoQm3Uqou+vKrZSI0YpJcpTOqaxMms=

X-Firefox-Spdy  2

 

Request header 5:

 

(Request-Line)  GET /oauth/login?oauth_provider=FacebookProvider&code=AQDnuTVWhpHlsydBsEWiOo8TYnSYjF6a0YVAFs9SIQj8CA2nXRTQEZVadzTcxdhe3RwCLKnXm1wbJMoTmGz8V6mJMZOOyZl6dNf2HfA5gTxana0RNZSlYXBkqHWVM7XqUOlKWrvRJey82WtbUKyacbEFx09q0VOb1edXTAgxFqFLx-m-FPXYFzxr9s-XvLwLnc6HcZ3rG8jDBOUtsYfX9IUnAWn0zRPdFxhs5UGNVxRIyOwkVcdbDWzWWy1CaB0LxWjA7VY2lyYbBdnjyjT13SGz5NB1xZKD_cShnsgMVZrgxJwEvWKmIFCmBQTUrysra5c&state=jRRdDS8SME HTTP/1.1

Host       login.tumbhi.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Cookie  loginCalledFrom=tumbhi; JSESSIONID=2b563b8847e8e8d45b9f00706bca

Connection         keep-alive

 

Response header 5:

 

(Status-Line)      HTTP/1.1 302 Moved Temporarily

X-Powered-By  Servlet/2.5

Server   Sun GlassFish Enterprise Server v2.1.1

Pragma no-cache

Expires Thu, 01 Jan 1970 00:00:00 GMT

Cache-Control   no-cache, no-store

Set-Cookie          CASTGC=TGT-415-PDTMylZWcpmbrSZxSucueEke69Zxg95DebrT6rMvcFY94ednHW-cas01.example.org; Path=/oauth/

Location               http://www.tumbhi.com/j_spring_cas_security_check?ticket=ST-698-4q691DIfz4KLPbif59Hq-cas01.example.org

Date      Tue, 03 Sep 2013 07:25:57 GMT

Content-Type    text/html; charset=iso-8859-1

Content-Length                0

 

 

Thanks and Regards,

Rohit Kotecha

 

 

request response in httpfox tool.JPG

Jérôme LELEU

unread,
Sep 3, 2013, 6:59:52 AM9/3/13
to cas-...@lists.jasig.org
Hi,

Your logs look normal : some Facebook requests to post credentials and authenticate.
Then your are redirected to your CAS server with the oauth_provider and code parameters. I assume that the /oauth url is the context path of your CAS server.
The authentication is successful in the CAS server and finally you are redirected to the original requested service : http://www.tumbhi.com/j_spring_cas_security_check with a service ticket.

I need a more complete record : from the login page in your CAS server when you click on "Authenticate in Facebook" to the loop itself between Facebook and the CAS server (just the first iteration of the loop will be sufficient).

Thanks.
Best regards,
Jérôme




2013/9/3 Rohit Kotecha <rohit....@nihilent.com>

Rohit Kotecha

unread,
Sep 5, 2013, 6:03:16 AM9/5/13
to cas-...@lists.jasig.org

Hi Jerome,

 

Thanks for your help.

 

Below is the request and response header from point when user click on "Authentication with Facebook link".

 

Request 1:

(Request-Line)  GET /dialog/oauth?client_id=299691956741084&redirect_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=WwzZwdPPvW&scope=email HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

 

Response 1:

 

(Status-Line)      HTTP/1.1 302 OK

Cache-Control   private, no-cache, no-store, must-revalidate

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Thu, 05 Sep 2013 09:56:03 GMT

Expires Sat, 01 Jan 2000 00:00:00 GMT

Pragma no-cache

X-Content-Type-Options              nosniff

X-Frame-Options             DENY

X-XSS-Protection             0

X-FB-Debug        GobK1yuKTF7jVjO0WxLFWtbbt6Oe42sfgEuIz85Xm8I=

X-Firefox-Spdy  3

 

Request 2:

 

(Request-Line)  POST /login.php?login_attempt=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DWwzZwdPPvW%26scope%3Demail%26client_id%3D299691956741084%26ret%3Dlogin HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=299691956741084&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DWwzZwdPPvW%26scope%3Demail%26client_id%3D299691956741084%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DWwzZwdPPvW%23_%3D_&display=page

Cookie  datr=NFUoUtJyEzdazVyO22hu3lLa; reg_ext_ref=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Fservice%3Dhttp%253A%252F%252Feqa.nihilent.com%252FVenice_URL%252Fj_spring_cas_security_check; reg_fb_gate=https%3A%2F%2Fwww.facebook.com%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D299691956741084%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.nihilent.com%25253A8080%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DWwzZwdPPvW%2526scope%253Demail%2526client_id%253D299691956741084%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DWwzZwdPPvW%2523_%253D_%26display%3Dpage; reg_fb_ref=https%3A%2F%2Fwww.facebook.com%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D299691956741084%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.nihilent.com%25253A8080%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DWwzZwdPPvW%2526scope%253Demail%2526client_id%253D299691956741084%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DWwzZwdPPvW%2523_%253D_%26display%3Dpage; wd=1280x200; act=1378374993008%2F1; _e_0pnQ_0=%5B%220pnQ%22%2C1378374971659%2C%22act%22%2C1378374971656%2C0%2C%22email%22%2C%22click%22%2C%22click%22%2C%22-%22%2C%22r%22%2C%22%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D299691956741084%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.nihilent.com%25253A8080%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DWwzZwdPPvW%2526scope%253Demail%2526client_id%253D299691956741084%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DWwzZwdPPvW%2523_%253D_%26display%3Dpage%22%2C%7B%22ft%22%3A%7B%7D%2C%22gt%22%3A%7B%7D%7D%2C0%2C0%2C0%2C981%2C16%5D; _e_0pnQ_1=%5B%220pnQ%22%2C1378374993010%2C%22act%22%2C1378374993008%2C1%2C%22login%22%2C%22click%22%2C%22click%22%2C%22-%22%2C%22r%22%2C%22%2Flogin.php%3Fskip_api_login%3D1%26api_key%3D299691956741084%26signed_next%3D1%26next%3Dhttps%253A%252F%252Fwww.facebook.com%252Fdialog%252Foauth%253Fredirect_uri%253Dhttp%25253A%25252F%25252Flogin.nihilent.com%25253A8080%25252Foauth%25252Flogin%25253Foauth_provider%25253DFacebookProvider%2526state%253DWwzZwdPPvW%2526scope%253Demail%2526client_id%253D299691956741084%2526ret%253Dlogin%26cancel_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%2526error%253Daccess_denied%2526error_code%253D200%2526error_description%253DPermissions%252Berror%2526error_reason%253Duser_denied%2526state%253DWwzZwdPPvW%2523_%253D_%26display%3Dpage%22%2C%7B%22ft%22%3A%7B%7D%2C%22gt%22%3A%7B%7D%7D%2C0%2C0%2C0%2C981%2C16%5D

Connection         keep-alive

Content-Type    application/x-www-form-urlencoded

Content-Length                533

 

Response 2:

 

(Status-Line)      HTTP/1.1 302 OK

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Thu, 05 Sep 2013 09:57:22 GMT

Location               https://www.facebook.com/dialog/oauth?redirect_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=WwzZwdPPvW&scope=email&client_id=299691956741084&ret=login&ext=1378378642&hash=Aeajjzf_uL3XPs8Z

P3P        CP="Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p"

Set-Cookie          act=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          c_user=100006251472506; path=/; domain=.facebook.com; secure

Set-Cookie          csm=2; path=/; domain=.facebook.com

Set-Cookie          datr=NFUoUtJyEzdazVyO22hu3lLa; expires=Sat, 05-Sep-2015 09:57:22 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          fr=0Yq2uNb0y357DGNli.AWWa7UgpklNORqXOEasiuMOneIg.BSKFWC.gC.AAA.AWW2Yp1s; expires=Sat, 05-Oct-2013 09:57:22 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          lu=RgB-oKpv30Fghf669QUQlgyg; expires=Sat, 05-Sep-2015 09:57:22 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          reg_ext_ref=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          reg_fb_gate=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          reg_fb_ref=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com

Set-Cookie          s=Aa5fzJ1fMh4uuXOV.BSKFWC; path=/; domain=.facebook.com; secure; httponly

Set-Cookie          wd=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          xs=65%3AKINVpcGezOySyg%3A2%3A1378375042%3A2031; path=/; domain=.facebook.com; secure; httponly

Set-Cookie          _e_0pnQ_1=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

Set-Cookie          _e_0pnQ_0=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly

X-Content-Type-Options              nosniff

X-FB-Debug        In/uJ6KD2a6iTTqjotqtS6vm2MatfxcQT0w7HcMXVXM=

X-Firefox-Spdy  3

 

Request 3:

 

(Request-Line)  GET /dialog/oauth?redirect_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=WwzZwdPPvW&scope=email&client_id=299691956741084&ret=login&ext=1378378642&hash=Aeajjzf_uL3XPs8Z HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=299691956741084&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DWwzZwdPPvW%26scope%3Demail%26client_id%3D299691956741084%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DWwzZwdPPvW%23_%3D_&display=page

Cookie  datr=NFUoUtJyEzdazVyO22hu3lLa; c_user=100006251472506; csm=2; fr=0Yq2uNb0y357DGNli.AWWa7UgpklNORqXOEasiuMOneIg.BSKFWC.gC.AAA.AWW2Yp1s; lu=RgB-oKpv30Fghf669QUQlgyg; s=Aa5fzJ1fMh4uuXOV.BSKFWC; xs=65%3AKINVpcGezOySyg%3A2%3A1378375042%3A2031

Connection         keep-alive

 

Response 3:

 

(Status-Line)      HTTP/1.1 302 OK

Cache-Control   private, no-cache, no-store, must-revalidate

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Thu, 05 Sep 2013 09:57:23 GMT

Expires Sat, 01 Jan 2000 00:00:00 GMT

Pragma no-cache

X-Content-Type-Options              nosniff

X-Frame-Options             DENY

X-XSS-Protection             0

X-FB-Debug        j1oabBSaJgqT4j2OiBraiqgnlyDWPIfE3ayukVOgdHc=

X-Firefox-Spdy  3

 

Request 4:

 

(This request is causing NS_BINDING_ABBORT)

 

(Request-Line)  GET /oauth/login?oauth_provider=FacebookProvider&code=AQCS0REnbUCpG4a5MCcWAzjvh0JvgvmzgCCZNuGb8gjmkqxpmitOtTOSHaGe0YXE3kDJGPFYkU600iPexBI5NR--JQq6vThbadeeyvvh66kjiWUdj-IMzMk9S4L4fgxj5QmHQYfjZyPAO3L2p5xcP0g-axJ8QhArkq0a9tYz8aM57QhgZj1-67fRxuDrt6BV4RAfqp91-QeXQwx-PjkLyiVEA4nECDHpA8YLDBOb-ck6Y2ttgqse7E-itP3e8y1m-A_3AVjKOpTB3duCj1QkX1DiAd4wiRKyBBm1Qin0GgpBtZp5md-4uy03_LiWNatKM7o&state=WwzZwdPPvW HTTP/1.1

Host       login.nihilent.com:8080

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Cookie  loginCalledFrom=tumbhi; JSESSIONID=d8c0380a6e22c4506bbc81b686c6

 

Response 4:

 

Blank

 

Request 5:

 

(Request-Line)  GET /dialog/oauth?redirect_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider&state=WwzZwdPPvW&scope=email&client_id=299691956741084&ret=login HTTP/1.1

Host       www.facebook.com

User-Agent        Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language             en-US,en;q=0.5

Accept-Encoding              gzip, deflate

Referer                https://www.facebook.com/login.php?skip_api_login=1&api_key=299691956741084&signed_next=1&next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Foauth%3Fredirect_uri%3Dhttp%253A%252F%252Flogin.nihilent.com%253A8080%252Foauth%252Flogin%253Foauth_provider%253DFacebookProvider%26state%3DWwzZwdPPvW%26scope%3Demail%26client_id%3D299691956741084%26ret%3Dlogin&cancel_uri=http%3A%2F%2Flogin.nihilent.com%3A8080%2Foauth%2Flogin%3Foauth_provider%3DFacebookProvider%26error%3Daccess_denied%26error_code%3D200%26error_description%3DPermissions%2Berror%26error_reason%3Duser_denied%26state%3DWwzZwdPPvW%23_%3D_&display=page

Cookie  datr=NFUoUtJyEzdazVyO22hu3lLa; c_user=100006251472506; csm=2; fr=0Yq2uNb0y357DGNli.AWWa7UgpklNORqXOEasiuMOneIg.BSKFWC.gC.AAA.AWW2Yp1s; lu=RgB-oKpv30Fghf669QUQlgyg; s=Aa5fzJ1fMh4uuXOV.BSKFWC; xs=65%3AKINVpcGezOySyg%3A2%3A1378375042%3A2031

Connection         keep-alive

 

Response 5:

 

(Status-Line)      HTTP/1.1 302 OK

Cache-Control   private, no-cache, no-store, must-revalidate

Content-Length                0

Content-Type    text/html; charset=utf-8

Date      Thu, 05 Sep 2013 09:57:25 GMT

Expires Sat, 01 Jan 2000 00:00:00 GMT

Pragma no-cache

X-Content-Type-Options              nosniff

X-Frame-Options             DENY

X-XSS-Protection             0

X-FB-Debug        oG65paO9NyDIIgvbQ6+LLkWiyKFlsPB4O0HozvYxzgk=

X-Firefox-Spdy  3

 

And after that again same request loop is going on.

 

Thanks and Regards,

Rohit kotecha

Jérôme LELEU

unread,
Sep 5, 2013, 12:10:15 PM9/5/13
to cas-...@lists.jasig.org
Hi,

In fact, you are never redirected back to your application in these recorded HTTP requests. I thought you were ?

Anyway, the problem happens at request 4 : you are back on your CAS server with a code and the appropriate provider. At that point, the code should be exchanged (HTTP calls to Facebook) with an access token and the user profile should be retrieved before a redirection to your client application.
The NS_BINDING_ABORT is strange : it seems that you are trying to load something else at the same time.

Some questions : do you have Javascript customizations on your login page ? can you reach internet (and Facebook) from your production servers or does it require a specific configuration ? Because it's needed to get the access token and the user profile from Facebook.

Did you try some debugging in the OAuthAction class as it's called when you come back to your CAS server after a successful Facebook authentication (request 4) ?

Best regards,
Jérôme



2013/9/5 Rohit Kotecha <rohit....@nihilent.com>

Rohit Kotecha

unread,
Sep 11, 2013, 3:27:54 AM9/11/13
to cas-...@lists.jasig.org

Hi Jerome,

 

Thanks for reply.

 

Ans to your question..

 

We are using CAS login page only. no javascript customization. but we added some javascript function. We added one link on CAS login page when user click on it, javascript will get executed.

and inside that javascript we are calling our application specific method.

we have use jquery for that.

 

and yes we are able to reach facebook from production server.

and I am attaching cas.log file for OAuthAction debug.

cas.log

Jérôme LELEU

unread,
Sep 11, 2013, 10:04:29 AM9/11/13
to cas-...@lists.jasig.org
Hi,

I'm not completely sure to understand what you are doing when executing your Javascript source code. Why not using the simple login page ?
As it work without that Javascript enhancement, I tend to think that it comes from that.
In your logs, I see two successful Facebook authentications, the second one "overrriding" the first one (the first TGT is destroyed). Looks like things happens almost at the same time, like two parallel HTTP requests executing...
Best regards,
Jérôme




2013/9/11 Rohit Kotecha <rohit....@nihilent.com>

Rohit Kotecha

unread,
Sep 11, 2013, 10:14:34 AM9/11/13
to cas-...@lists.jasig.org

Hi Jerome,

 

Same problem we are facing with simple login page also. no javascript included.

Jérôme LELEU

unread,
Sep 12, 2013, 8:47:35 AM9/12/13
to cas-...@lists.jasig.org
Hi,

I definitely don't know what is the explanation. I've made once again a global test with a CASsified application and a CAS server using Facebook :

First term :
cd play-pac4j-java-demo
/usr/local/play-2.1.0/play run
Second term :
cd cas-pac4j-oauth-demo/
mvn clean install
cd cas-pac4j-oauth-client-demo/
mvn jetty:run

Test :
click on "Protected url by CAS"
click on "Authenticate with Facebook"
Authenticate at Facebook
I'm back in my original application, authenticated !

Best regards,
Jérôme




Rohit Kotecha

unread,
Sep 26, 2013, 9:19:09 AM9/26/13
to cas-...@lists.jasig.org

Hi Jerome,

 

This pac4j and scribe up library are different or same?

 

can we make test like below?

 

after authentication with facebook control comes to application and at that poin before displaying home page in one of the services if we put delay or I can say Thread.sleep of 5 mins and see what will be the result.

Jérôme LELEU

unread,
Sep 26, 2013, 10:51:05 AM9/26/13
to cas-...@lists.jasig.org
Hi,

pac4j is the successor of scribe-up : scribe-up only works for OAuth whereas pac4j works for OAuth, OpenID, CAS... pac4j is a rebuilt of scribe-up to be more generic and target more use cases and protocols.

You can of course do by yourself the test I propose. I use these webapps because I know them well.
It's a complete test from a webapp with CAS client (play-pac4j-java-demo) to a CAS server which can delegate authentication to Facebook (cas-pac4j-oauth-demo).
In addition to unit tests, that's generally how I perform tests on OAuth client support.

To be closer to your problem, it can be good idea to add a delay of 5 seconds.

I have many demos to test all pac4j libraries (http://www.pac4j.org) and this one uses Play. It might be easier for you to use https://github.com/leleuj/spring-security-pac4j-demo, which is a webapp to test the spring-security-pac4j library and where some urls are protected by an external CAS server. It's in Java & Spring Security.

Best regards,
Jérôme




2013/9/26 Rohit Kotecha <rohit....@nihilent.com>
Reply all
Reply to author
Forward
0 new messages