我正在尝试基于此示例在我的移动应用后端实现 OAuth2 安全性。
该示例使用springBootVersion = '1.0.2.RELEASE'
. 在我的项目中,我使用的是 1.1.7.RELEASE。在有几个莫名其妙的 400 - Bad Requests 之后,我开始配对依赖项。
因此,当我将示例 Spring Boot 版本设置为等于我的版本时,它会停止编译。具体是找不到**.**之间的方法。
// This method configures the OAuth scopes required by clients to access
// all of the paths in the video service.
@Override
public void configure(HttpSecurity http) throws Exception {
http.**csrf**().disable();
http
.**authorizeRequests**()
.antMatchers("/oauth/token").anonymous();
http
.**authorizeRequests**()
.antMatchers(HttpMethod.GET, "/**")
.access("#oauth2.hasScope('read')");
http
.**authorizeRequests**()
.antMatchers("/**")
.access("#oauth2.hasScope('write')");
}
}
我相信与应用程序安全性相关的 gradle 依赖项是:
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")
compile("org.springframework.security.oauth:spring-security-oauth2:2.0.0.RC2")
compile("org.springframework.security.oauth:spring-security-oauth2-javaconfig:1.0.0.M1")
这些是示例中的原始内容。然而,有趣的是,在我的应用程序中,我从来没有遇到编译错误,但它也不起作用。我与示例应用程序一起运行的测试用例运行良好。
我在这里真的很困惑。我应该更改任何这些依赖项吗?提前感谢您的任何支持。
编辑
简单的问候控制器:
public interface GreetingSvcApi {
public static final String GREETING_PATH = "/greeting";
@GET(GREETING_PATH)
public Greeting greeting(@Query("name") String name);
}
@Controller
public class GreetingController {
@RequestMapping(value = GreetingSvcApi.GREETING_PATH, method = RequestMethod.GET)
public
@ResponseBody
Greeting greeting(@RequestParam(value = "name", required = false, defaultValue = "Hello Developer") String name) {
return new Greeting(name);
}
}
public class GreetingControllerTest extends TestCase {
private final String USERNAME = "admin";
private final String PASSWORD = "pass";
private final String CLIENT_ID = "mobile";
private final String READ_ONLY_CLIENT_ID = "mobileReader";
private GreetingSvcApi greetingService = new SecuredRestBuilder()
.setLoginEndpoint(RestDataFixture.SERVER_HTTPS + BaseServiceApi.TOKEN_PATH)
.setUsername(USERNAME)
.setPassword(PASSWORD)
.setClientId(CLIENT_ID)
.setClient(new ApacheClient(UnsafeHttpsClient.createUnsafeClient()))
.setEndpoint(RestDataFixture.SERVER_HTTPS).setLogLevel(RestAdapter.LogLevel.FULL).build()
.create(GreetingSvcApi.class);
public void testGreetingInHttp() throws Exception {
Greeting greeting = greetingService.greeting("Greeting");
assertEquals(greeting.getPerson(), "Greeting");
}
}
预期输出:
o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: best-match
o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
o.a.h.impl.execchain.MainClientExec - Opening connection {s}->https://localhost:8443
o.a.h.i.c.HttpClientConnectionOperator - Connecting to localhost/127.0.0.1:8443
o.a.h.i.c.HttpClientConnectionOperator - Connection established 127.0.0.1:57518<->127.0.0.1:8443
o.a.h.impl.execchain.MainClientExec - Executing request POST /oauth/token HTTP/1.1
o.a.h.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
org.apache.http.headers - http-outgoing-0 >> POST /oauth/token HTTP/1.1
org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bW9iaWxlOg==
org.apache.http.headers - http-outgoing-0 >> Content-Length: 80
org.apache.http.headers - http-outgoing-0 >> Content-Type: application/x-www-form-urlencoded; charset=UTF-8
org.apache.http.headers - http-outgoing-0 >> Host: localhost:8443
org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.4 (java 1.5)
org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
org.apache.http.wire - http-outgoing-0 >> "POST /oauth/token HTTP/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bW9iaWxlOg==[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Length: 80[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/x-www-form-urlencoded; charset=UTF-8[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Host: localhost:8443[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.4 (java 1.5)[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "username=admin&password=pass&client_id=mobile&client_secret=&grant_type=password"
org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Server: Apache-Coyote/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Expires: 0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000 ; includeSubDomains[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Application-Context: application[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-store[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Content-Type: application/hal+json[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Date: Fri, 31 Oct 2014 19:03:42 GMT[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "75[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "{"access_token":"1a59e04c-afb0-40cd-9e17-4e573beea347","token_type":"bearer","expires_in":43199,"scope":"read write"}[\r][\n]"
org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK
org.apache.http.headers - http-outgoing-0 << Server: Apache-Coyote/1.1
org.apache.http.headers - http-outgoing-0 << X-Content-Type-Options: nosniff
org.apache.http.headers - http-outgoing-0 << X-XSS-Protection: 1; mode=block
org.apache.http.headers - http-outgoing-0 << Cache-Control: no-cache, no-store, max-age=0, must-revalidate
org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
org.apache.http.headers - http-outgoing-0 << Expires: 0
org.apache.http.headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000 ; includeSubDomains
org.apache.http.headers - http-outgoing-0 << X-Frame-Options: DENY
org.apache.http.headers - http-outgoing-0 << X-Application-Context: application
org.apache.http.headers - http-outgoing-0 << Cache-Control: no-store
org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
org.apache.http.headers - http-outgoing-0 << Content-Type: application/hal+json
org.apache.http.headers - http-outgoing-0 << Transfer-Encoding: chunked
org.apache.http.headers - http-outgoing-0 << Date: Fri, 31 Oct 2014 19:03:42 GMT
o.a.h.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
org.apache.http.wire - http-outgoing-0 << "0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection [id: 0][route: {s}->https://localhost:8443] can be kept alive indefinitely
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://localhost:8443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
---> HTTP GET https://localhost:8443/greeting?name=Greeting
Authorization: Bearer 1a59e04c-afb0-40cd-9e17-4e573beea347
---> END HTTP (no body)
o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: best-match
o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://localhost:8443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
o.a.h.impl.execchain.MainClientExec - Stale connection check
org.apache.http.wire - http-outgoing-0 << "[read] I/O error: Read timed out"
o.a.h.impl.execchain.MainClientExec - Executing request GET /greeting?name=Greeting HTTP/1.1
o.a.h.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
org.apache.http.headers - http-outgoing-0 >> GET /greeting?name=Greeting HTTP/1.1
org.apache.http.headers - http-outgoing-0 >> Authorization: Bearer 1a59e04c-afb0-40cd-9e17-4e573beea347
org.apache.http.headers - http-outgoing-0 >> Host: localhost:8443
org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.4 (java 1.5)
org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
org.apache.http.wire - http-outgoing-0 >> "GET /greeting?name=Greeting HTTP/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Authorization: Bearer 1a59e04c-afb0-40cd-9e17-4e573beea347[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Host: localhost:8443[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.4 (java 1.5)[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Server: Apache-Coyote/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Expires: 0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000 ; includeSubDomains[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Set-Cookie: JSESSIONID=8FC93D46387663ED9D1EA7F97C7F9B45; Path=/; Secure; HttpOnly[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Application-Context: application[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Content-Type: application/hal+json[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Date: Fri, 31 Oct 2014 19:03:42 GMT[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "2a[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "{"person":"Greeting","date":1414782222693}[\r][\n]"
org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK
org.apache.http.headers - http-outgoing-0 << Server: Apache-Coyote/1.1
org.apache.http.headers - http-outgoing-0 << X-Content-Type-Options: nosniff
org.apache.http.headers - http-outgoing-0 << X-XSS-Protection: 1; mode=block
org.apache.http.headers - http-outgoing-0 << Cache-Control: no-cache, no-store, max-age=0, must-revalidate
org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
org.apache.http.headers - http-outgoing-0 << Expires: 0
org.apache.http.headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000 ; includeSubDomains
org.apache.http.headers - http-outgoing-0 << X-Frame-Options: DENY
org.apache.http.headers - http-outgoing-0 << Set-Cookie: JSESSIONID=8FC93D46387663ED9D1EA7F97C7F9B45; Path=/; Secure; HttpOnly
org.apache.http.headers - http-outgoing-0 << X-Application-Context: application
org.apache.http.headers - http-outgoing-0 << Content-Type: application/hal+json
org.apache.http.headers - http-outgoing-0 << Transfer-Encoding: chunked
org.apache.http.headers - http-outgoing-0 << Date: Fri, 31 Oct 2014 19:03:42 GMT
o.a.h.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
o.a.h.c.p.ResponseProcessCookies - Cookie accepted [JSESSIONID="8FC93D46387663ED9D1EA7F97C7F9B45", version:0, domain:localhost, path:/, expiry:null]
org.apache.http.wire - http-outgoing-0 << "0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection [id: 0][route: {s}->https://localhost:8443] can be kept alive indefinitely
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://localhost:8443][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
<--- HTTP 200 https://localhost:8443/greeting?name=Greeting (324ms)
Server: Apache-Coyote/1.1
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Set-Cookie: JSESSIONID=8FC93D46387663ED9D1EA7F97C7F9B45; Path=/; Secure; HttpOnly
X-Application-Context: application
Content-Type: application/hal+json
Transfer-Encoding: chunked
Date: Fri, 31 Oct 2014 19:03:42 GMT
{"person":"Greeting","date":1414782222693}
<--- END HTTP (42-byte body)
Process finished with exit code 0
实际输出:
o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: best-match
o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
o.a.h.impl.execchain.MainClientExec - Opening connection {s}->https://localhost:8443
o.a.h.i.c.HttpClientConnectionOperator - Connecting to localhost/127.0.0.1:8443
o.a.h.i.c.HttpClientConnectionOperator - Connection established 127.0.0.1:55456<->127.0.0.1:8443
o.a.h.impl.execchain.MainClientExec - Executing request POST /oauth/token HTTP/1.1
o.a.h.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
org.apache.http.headers - http-outgoing-0 >> POST /oauth/token HTTP/1.1
org.apache.http.headers - http-outgoing-0 >> Authorization: Basic bW9iaWxlOg==
org.apache.http.headers - http-outgoing-0 >> Content-Length: 80
org.apache.http.headers - http-outgoing-0 >> Content-Type: application/x-www-form-urlencoded; charset=UTF-8
org.apache.http.headers - http-outgoing-0 >> Host: localhost:8443
org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.4 (java 1.5)
org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
org.apache.http.wire - http-outgoing-0 >> "POST /oauth/token HTTP/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Authorization: Basic bW9iaWxlOg==[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Length: 80[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/x-www-form-urlencoded; charset=UTF-8[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Host: localhost:8443[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.4 (java 1.5)[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"
org.apache.http.wire - http-outgoing-0 >> "username=admin&password=pass&client_id=mobile&client_secret=&grant_type=password"
org.apache.http.wire - http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Server: Apache-Coyote/1.1[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-cache, no-store, max-age=0, must-revalidate[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Expires: 0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Strict-Transport-Security: max-age=31536000 ; includeSubDomains[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Frame-Options: DENY[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "X-Application-Context: application:8443[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Cache-Control: no-store[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Pragma: no-cache[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Content-Type: application/json;charset=UTF-8[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Date: Fri, 31 Oct 2014 18:06:51 GMT[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "Connection: close[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "3f[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "{"error":"invalid_grant","error_description":"Bad credentials"}[\r][\n]"
org.apache.http.headers - http-outgoing-0 << HTTP/1.1 400 Bad Request
org.apache.http.headers - http-outgoing-0 << Server: Apache-Coyote/1.1
org.apache.http.headers - http-outgoing-0 << X-Content-Type-Options: nosniff
org.apache.http.headers - http-outgoing-0 << X-XSS-Protection: 1; mode=block
org.apache.http.headers - http-outgoing-0 << Cache-Control: no-cache, no-store, max-age=0, must-revalidate
org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
org.apache.http.headers - http-outgoing-0 << Expires: 0
org.apache.http.headers - http-outgoing-0 << Strict-Transport-Security: max-age=31536000 ; includeSubDomains
org.apache.http.headers - http-outgoing-0 << X-Frame-Options: DENY
org.apache.http.headers - http-outgoing-0 << X-Application-Context: application:8443
org.apache.http.headers - http-outgoing-0 << Cache-Control: no-store
org.apache.http.headers - http-outgoing-0 << Pragma: no-cache
org.apache.http.headers - http-outgoing-0 << Content-Type: application/json;charset=UTF-8
org.apache.http.headers - http-outgoing-0 << Transfer-Encoding: chunked
org.apache.http.headers - http-outgoing-0 << Date: Fri, 31 Oct 2014 18:06:51 GMT
org.apache.http.headers - http-outgoing-0 << Connection: close
org.apache.http.wire - http-outgoing-0 << "0[\r][\n]"
org.apache.http.wire - http-outgoing-0 << "[\r][\n]"
o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
o.a.h.impl.execchain.MainClientExec - Connection discarded
o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: Close connection
o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://localhost:8443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
---- ERROR
org.portotech.pague360mpayments.security.SecuredRestException: org.portotech.pague360mpayments.security.SecuredRestException: Login failure: 400 - Bad Request
at org.portotech.pague360mpayments.security.SecuredRestBuilder$OAuthHandler.intercept(SecuredRestBuilder.java:150)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:300)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
at com.sun.proxy.$Proxy2.greeting(Unknown Source)
at org.portotech.pague360mpayments.rest.controller.GreetingControllerTest.testGreetingInHttp(GreetingControllerTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.portotech.pague360mpayments.security.SecuredRestException: Login failure: 400 - Bad Request
at org.portotech.pague360mpayments.security.SecuredRestBuilder$OAuthHandler.intercept(SecuredRestBuilder.java:138)
... 26 more
---- END ERROR
retrofit.RetrofitError: org.portotech.pague360mpayments.security.SecuredRestException: Login failure: 400 - Bad Request
at retrofit.RetrofitError.unexpectedError(RetrofitError.java:44)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:395)
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
at com.sun.proxy.$Proxy2.greeting(Unknown Source)
at org.portotech.pague360mpayments.rest.controller.GreetingControllerTest.testGreetingInHttp(GreetingControllerTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.portotech.pague360mpayments.security.SecuredRestException: org.portotech.pague360mpayments.security.SecuredRestException: Login failure: 400 - Bad Request
at org.portotech.pague360mpayments.security.SecuredRestBuilder$OAuthHandler.intercept(SecuredRestBuilder.java:150)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:300)
... 25 more
Caused by: org.portotech.pague360mpayments.security.SecuredRestException: Login failure: 400 - Bad Request
at org.portotech.pague360mpayments.security.SecuredRestBuilder$OAuthHandler.intercept(SecuredRestBuilder.java:138)
... 26 more
Process finished with exit code 255