0
Вот мой сценарий.Gatling Создать токен OAuth2.0 с использованием обратного вызова URL не работает
val header = Map(
"Accept" -> """application/json""",
"Content-Type" -> """application/x-www-form-urlencoded, charset=UTF-8""")
val auth_token = scenario("POST Authentication")
.exec(
http("POST OAuth Req")
.post("/validate/activationURL")
.formParam("oauth.token.client.secret", "*******")
.formParam("oauth.token.url", "https://myweb.com/as/token.oauth2")
.formParam("oauth.token.client.id", "my-test-user")
.formParam("oauth.token.grant.type", "client_credentials")
.formParam("oauth.token.scope", "my:test:activation")
.headers(header)
)
Но я получаю ошибку, как
=========================
HTTP request:
POST https://my-validation.net/validate/activationURL
headers=
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Content-Length: 305
Host: https://my-validation.net/
params=
oauth.token.client.secret: *******
oauth.token.url: https://myweb.com/as/token.oauth2
oauth.token.client.id: my-test-user
oauth.token.grant.type: client_credentials
oauth.token.scope: my:test:activation
=========================
HTTP response:
status=
401 Unauthorized
headers=
Cache-Control: no-store
Content-Type: application/json;charset=UTF-8
Date: Fri, 03 Feb 2017 03:30:40 GMT
Pragma: no-cache
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
Www-Authenticate: Bearer realm="oauth2-resource", error="unauthorized", error_description="Full authentication is required to access this resource"
X-Cf-Requestid: 4681a3da-a747-40f7-4801-b6b972b07cf6
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Xss-Protection: 1; mode=block
Content-Length: 102
body=
{"error":"unauthorized","error_description":"Full authentication is required to access this resource"}
<<<<<<<<<<<<<<<<<<<<<<<<<
20:30:40.972 [DEBUG] i.g.h.a.ResponseProcessor -
>>>>>>>>>>>>>>>>>>>>>>>>>>
Таким образом, вы пытаетесь получить маркер доступа? – FrAn