[
https://issues.apache.org/jira/browse/GEARPUMP-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16002448#comment-16002448
]
Karol Brejna commented on GEARPUMP-284:
---------------------------------------
>From my observation, the test that fails is:
>services/jvm/src/test/scala/org/apache/gearpump/services/security/oauth2/GoogleOAuth2AuthenticatorSpec.scala
The test tries to authenticate against google OAuth server.
The log relevant for the error is:
{code}
ExecutorSystemLauncherSpec:^[[0m^[[0m
- should report success when worker launch the system successfully^[[0m^[[0m
- should report failure when worker refuse to launch the system
explicitly^[[0m^[[0m
- should report timeout when trying to start a executor system on worker, and
worker doesn't response^[[0m^[[0m
CloudFoundryUAAOAuth2AuthenticatorSpec:^[[0m^[[0m
- should generate the correct authorization request^[[0m^[[0m
- should authenticate the authorization code and return the correct profile ***
FAILED ***^[[0m^[[0m
com.github.scribejava.core.exceptions.OAuthException: Response body is
incorrect. Can't extract a '"access_token"\s*:\s*"(\S*?)"' from this:
'<HTML>^M^[[0m^[[0m
<HEAD><TITLE>Redirection</TITLE></HEAD>^M^[[0m^[[0m
<BODY><H1>Redirect</H1></BODY>^M^[[0m^[[0m
'^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extractParameter(OAuth2AccessTokenJsonExtractor.java:64)^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:37)^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:12)^[[0m^[[0m
at
com.github.scribejava.core.oauth.OAuth20Service$1.convert(OAuth20Service.java:47)^[[0m^[[0m
at
com.github.scribejava.core.oauth.OAuth20Service$1.convert(OAuth20Service.java:43)^[[0m^[[0m
at
com.github.scribejava.core.model.OAuthRequestAsync$OAuthAsyncCompletionHandler.onCompleted(OAuthRequestAsync.java:104)^[[0m^[[0m
at
com.ning.http.client.AsyncCompletionHandler.onCompleted(AsyncCompletionHandler.java:55)^[[0m^[[0m
at
com.ning.http.client.providers.netty.future.NettyResponseFuture.getContent(NettyResponseFuture.java:177)^[[0m^[[0m
at
com.ning.http.client.providers.netty.future.NettyResponseFuture.done(NettyResponseFuture.java:214)^[[0m^[[0m
at
com.ning.http.client.providers.netty.handler.HttpProtocol.finishUpdate(HttpProtocol.java:194)^[[0m^[[0m
...^[[0m^[[0m
GoogleOAuth2AuthenticatorSpec:^[[0m^[[0m
- should generate the correct authorization request^[[0m^[[0m
- should authenticate the authorization code and return the correct profile ***
FAILED ***^[[0m^[[0m
com.github.scribejava.core.exceptions.OAuthException: Response body is
incorrect. Can't extract a '"access_token"\s*:\s*"(\S*?)"' from this:
'<HTML>^M^[[0m^[[0m
<HEAD><TITLE>Redirection</TITLE></HEAD>^M^[[0m^[[0m
<BODY><H1>Redirect</H1></BODY>^M^[[0m^[[0m
'^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extractParameter(OAuth2AccessTokenJsonExtractor.java:64)^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:37)^[[0m^[[0m
at
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor.extract(OAuth2AccessTokenJsonExtractor.java:12)^[[0m^[[0m
at
com.github.scribejava.core.oauth.OAuth20Service$1.convert(OAuth20Service.java:47)^[[0m^[[0m
at
com.github.scribejava.core.oauth.OAuth20Service$1.convert(OAuth20Service.java:43)^[[0m^[[0m
{code}
It looks, like authorize url has moved recently. For me the following change
worked:
- super.authorizeUrl.replace("https://accounts.google.com", host)
+ super.authorizeUrl.replace("https://accounts.google.com/ManageAccount",
host)
I didn't check the rest of the test (what responses are sent, what secured
endpoint it tries, etc. But I don't expect much changed there.
> Oauth2 tests fail
> -----------------
>
> Key: GEARPUMP-284
> URL: https://issues.apache.org/jira/browse/GEARPUMP-284
> Project: Apache Gearpump
> Issue Type: Bug
> Components: services
> Affects Versions: 0.8.2
> Reporter: Karol Brejna
> Assignee: Karol Brejna
> Original Estimate: 6h
> Remaining Estimate: 6h
>
> Running tests show that oauth2 tests fail.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)