Test tool version: 2.1.3
Issuer: https://oidc-certification.ory.sh:8443/
Profile: []
Test ID: OP-OAuth-2nd-Revokes
Test description: Trying to use authorization code twice should result in revoking previously issued access tokens
Timestamp: 2018-06-23T11:05:38Z

============================================================

Trace output

0.0 phase <--<-- 0 --- Webfinger -->-->
0.0 not expected to do WebFinger
0.0 phase <--<-- 1 --- Discovery -->-->
0.0 provider_config kwargs:{'issuer': 'https://oidc-certification.ory.sh:8443/'}
0.114 http response url:https://oidc-certification.ory.sh:8443/.well-known/openid-configuration status_code:200
0.116 ProviderConfigurationResponse {
    "authorization_endpoint": "https://oidc-certification.ory.sh:8443/oauth2/auth",
    "claims_parameter_supported": false,
    "claims_supported": [
        "sub"
    ],
    "grant_types_supported": [
        "authorization_code",
        "implicit",
        "client_credentials",
        "refresh_token"
    ],
    "id_token_signing_alg_values_supported": [
        "RS256"
    ],
    "issuer": "https://oidc-certification.ory.sh:8443/",
    "jwks_uri": "https://oidc-certification.ory.sh:8443/.well-known/jwks.json",
    "registration_endpoint": "https://oidc-certification.ory.sh:8443/clients",
    "request_parameter_supported": true,
    "request_uri_parameter_supported": true,
    "require_request_uri_registration": true,
    "response_modes_supported": [
        "query",
        "fragment"
    ],
    "response_types_supported": [
        "code",
        "code id_token",
        "id_token",
        "token id_token",
        "token",
        "token id_token code"
    ],
    "scopes_supported": [
        "offline",
        "openid"
    ],
    "subject_types_supported": [
        "pairwise",
        "public"
    ],
    "token_endpoint": "https://oidc-certification.ory.sh:8443/oauth2/token",
    "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "client_secret_basic",
        "private_key_jwt",
        "none"
    ],
    "userinfo_endpoint": "https://oidc-certification.ory.sh:8443/userinfo",
    "userinfo_signing_alg_values_supported": [
        "none",
        "RS256"
    ],
    "version": "3.0"
}
0.116 phase <--<-- 2 --- Registration -->-->
0.116 register kwargs:{'application_name': 'OIC test tool', 'response_types': ['code id_token token'], 'contacts': ['roland@example.com'], 'redirect_uris': ['https://op.certification.openid.net:61353/authz_cb'], 'post_logout_redirect_uris': ['https://op.certification.openid.net:61353/logout'], 'jwks_uri': 'https://op.certification.openid.net:61353/static/jwks_61353.json', 'grant_types': ['authorization_code', 'implicit'], 'application_type': 'web', 'url': 'https://oidc-certification.ory.sh:8443/clients'}
0.116 RegistrationRequest {
    "application_type": "web",
    "contacts": [
        "roland@example.com"
    ],
    "grant_types": [
        "authorization_code",
        "implicit"
    ],
    "jwks_uri": "https://op.certification.openid.net:61353/static/jwks_61353.json",
    "post_logout_redirect_uris": [
        "https://op.certification.openid.net:61353/logout"
    ],
    "redirect_uris": [
        "https://op.certification.openid.net:61353/authz_cb"
    ],
    "request_uris": [
        "https://op.certification.openid.net:61353/requests/e3ecc141f5419bd33d25d760861d32323144d583feaf26eb1b5cbf20147608b9#fbGNHHM64RX17pLF"
    ],
    "response_types": [
        "code id_token token"
    ]
}
0.314 http response url:https://oidc-certification.ory.sh:8443/clients status_code:201
0.314 RegistrationResponse {
    "client_id": "2d12d5b7-cdac-40b2-92af-0d7eae866149",
    "client_secret": "iRkfTprEtxM3",
    "client_secret_expires_at": 0,
    "contacts": [
        "roland@example.com"
    ],
    "grant_types": [
        "authorization_code",
        "implicit"
    ],
    "id": "2d12d5b7-cdac-40b2-92af-0d7eae866149",
    "jwks_uri": "https://op.certification.openid.net:61353/static/jwks_61353.json",
    "public": false,
    "redirect_uris": [
        "https://op.certification.openid.net:61353/authz_cb"
    ],
    "request_uris": [
        "https://op.certification.openid.net:61353/requests/e3ecc141f5419bd33d25d760861d32323144d583feaf26eb1b5cbf20147608b9#fbGNHHM64RX17pLF"
    ],
    "response_types": [
        "code id_token token"
    ],
    "scope": "openid offline offline_access profile email address phone",
    "token_endpoint_auth_method": "client_secret_basic",
    "userinfo_signed_response_alg": "none"
}
0.315 phase <--<-- 3 --- Note -->-->
1.772 phase <--<-- 4 --- AsyncAuthn -->-->
1.772 AuthorizationRequest {
    "client_id": "2d12d5b7-cdac-40b2-92af-0d7eae866149",
    "nonce": "KkvbhcodcfJzYZ88",
    "redirect_uri": "https://op.certification.openid.net:61353/authz_cb",
    "response_type": "code id_token token",
    "scope": "openid",
    "state": "XzfFpj7HlOY5mLtz"
}
1.772 redirect url https://oidc-certification.ory.sh:8443/oauth2/auth?scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61353%2Fauthz_cb&client_id=2d12d5b7-cdac-40b2-92af-0d7eae866149&state=XzfFpj7HlOY5mLtz&response_type=code+id_token+token&nonce=KkvbhcodcfJzYZ88
1.772 redirect https://oidc-certification.ory.sh:8443/oauth2/auth?scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61353%2Fauthz_cb&client_id=2d12d5b7-cdac-40b2-92af-0d7eae866149&state=XzfFpj7HlOY5mLtz&response_type=code+id_token+token&nonce=KkvbhcodcfJzYZ88
5.856 http args {}
6.04 response URL with fragment
6.04 response access_token=c3MrAuevrVdOz1bJTS1fp_GCvOABWhfIp_RMERpq7go.cZ8OIoBOJan0DK-qzpRm8X3Y7dcg6mOKZap_yIGQ3us&code=lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o&expires_in=3599&id_token=eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzplMjcyYTc1NS03YWUyLTQ5MGUtODJmNS02MmUwNjc4NjQxYjAiLCJ0eXAiOiJKV1QifQ.eyJhdF9oYXNoIjoiZ3RZRTNTWElxU0hwd2dqX3RQMHJyQSIsImF1ZCI6WyIyZDEyZDViNy1jZGFjLTQwYjItOTJhZi0wZDdlYWU4NjYxNDkiXSwiYXV0aF90aW1lIjoxNTI5NzUxODI0LCJjX2hhc2giOiIweHE2VnlVRVc3ZXhHanZneGx4WG1nIiwiZXhwIjoxNTI5NzU1NTM3LCJpYXQiOjE1Mjk3NTE5MzcsImlzcyI6Imh0dHBzOi8vb2lkYy1jZXJ0aWZpY2F0aW9uLm9yeS5zaDo4NDQzLyIsImp0aSI6ImU3NjcyNDc5LWVmYWEtNDgwNC05NGExLTA3NDU1ODU3NjhlNyIsIm5vbmNlIjoiS2t2Ymhjb2RjZkp6WVo4OCIsInJhdCI6MTUyOTc1MTkzMywic3ViIjoiZm9vQGJhci5jb20ifQ. &scope=openid&state=XzfFpj7HlOY5mLtz&token_type=bearer
6.04 response {'id_token': 'eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzplMjcyYTc1NS03YWUyLTQ5MGUtODJmNS02MmUwNjc4NjQxYjAiLCJ0eXAiOiJKV1QifQ.eyJhdF9oYXNoIjoiZ3RZRTNTWElxU0hwd2dqX3RQMHJyQSIsImF1ZCI6WyIyZDEyZDViNy1jZGFjLTQwYjItOTJhZi0wZDdlYWU4NjYxNDkiXSwiYXV0aF90aW1lIjoxNTI5NzUxODI0LCJjX2hhc2giOiIweHE2VnlVRVc3ZXhHanZneGx4WG1nIiwiZXhwIjoxNTI5NzU1NTM3LCJpYXQiOjE1Mjk3NTE5MzcsImlzcyI6Imh0dHBzOi8vb2lkYy1jZXJ0aWZpY2F0aW9uLm9yeS5zaDo4NDQzLyIsImp0aSI6ImU3NjcyNDc5LWVmYWEtNDgwNC05NGExLTA3NDU1ODU3NjhlNyIsIm5vbmNlIjoiS2t2Ymhjb2RjZkp6WVo4OCIsInJhdCI6MTUyOTc1MTkzMywic3ViIjoiZm9vQGJhci5jb20ifQ. ', 'scope': 'openid', 'code': 'lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o', 'access_token': 'c3MrAuevrVdOz1bJTS1fp_GCvOABWhfIp_RMERpq7go.cZ8OIoBOJan0DK-qzpRm8X3Y7dcg6mOKZap_yIGQ3us', 'state': 'XzfFpj7HlOY5mLtz', 'expires_in': 3599, 'token_type': 'bearer'}
6.155 AuthorizationResponse {
    "access_token": "c3MrAuevrVdOz1bJTS1fp_GCvOABWhfIp_RMERpq7go.cZ8OIoBOJan0DK-qzpRm8X3Y7dcg6mOKZap_yIGQ3us",
    "code": "lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o",
    "expires_in": 3599,
    "id_token": {
        "at_hash": "gtYE3SXIqSHpwgj_tP0rrA",
        "aud": [
            "2d12d5b7-cdac-40b2-92af-0d7eae866149"
        ],
        "auth_time": 1529751824,
        "c_hash": "0xq6VyUEW7exGjvgxlxXmg",
        "exp": 1529755537,
        "iat": 1529751937,
        "iss": "https://oidc-certification.ory.sh:8443/",
        "jti": "e7672479-efaa-4804-94a1-0745585768e7",
        "nonce": "KkvbhcodcfJzYZ88",
        "rat": 1529751933,
        "sub": "foo@bar.com"
    },
    "scope": "openid",
    "state": "XzfFpj7HlOY5mLtz",
    "token_type": "bearer"
}
6.155 phase <--<-- 5 --- AccessToken -->-->
6.155 --> request op_args: {'state': 'XzfFpj7HlOY5mLtz'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61353/authz_cb'}
6.155 do_access_token_request kwargs:{'request_args': {'grant_type': 'authorization_code', 'state': 'XzfFpj7HlOY5mLtz', 'code': 'lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o', 'redirect_uri': 'https://op.certification.openid.net:61353/authz_cb', 'client_id': '2d12d5b7-cdac-40b2-92af-0d7eae866149'}, 'state': 'XzfFpj7HlOY5mLtz'}
6.155 AccessTokenRequest {
    "code": "lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61353/authz_cb",
    "state": "XzfFpj7HlOY5mLtz"
}
6.155 request_url https://oidc-certification.ory.sh:8443/oauth2/token
6.155 request_http_args {'headers': {'Authorization': 'Basic MmQxMmQ1YjctY2RhYy00MGIyLTkyYWYtMGQ3ZWFlODY2MTQ5OmlSa2ZUcHJFdHhNMw==', 'Content-Type': 'application/x-www-form-urlencoded'}}
6.155 request code=lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61353%2Fauthz_cb&grant_type=authorization_code&state=XzfFpj7HlOY5mLtz
6.366 http response url:https://oidc-certification.ory.sh:8443/oauth2/token status_code:200
6.367 response {'id_token': 'eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzplMjcyYTc1NS03YWUyLTQ5MGUtODJmNS02MmUwNjc4NjQxYjAiLCJ0eXAiOiJKV1QifQ.eyJhdF9oYXNoIjoiZ3RZRTNTWElxU0hwd2dqX3RQMHJyQSIsImF1ZCI6WyIyZDEyZDViNy1jZGFjLTQwYjItOTJhZi0wZDdlYWU4NjYxNDkiXSwiYXV0aF90aW1lIjoxNTI5NzUxODI0LCJjX2hhc2giOiIweHE2VnlVRVc3ZXhHanZneGx4WG1nIiwiZXhwIjoxNTI5NzU1NTM3LCJpYXQiOjE1Mjk3NTE5MzgsImlzcyI6Imh0dHBzOi8vb2lkYy1jZXJ0aWZpY2F0aW9uLm9yeS5zaDo4NDQzLyIsImp0aSI6IjAzYmU4NjkzLWNmZGMtNDQ1Zi1hZWM4LTkzZjVhYTEwYjQ3ZCIsIm5vbmNlIjoiS2t2Ymhjb2RjZkp6WVo4OCIsInJhdCI6MTUyOTc1MTkzMywic3ViIjoiZm9vQGJhci5jb20ifQ. ', 'token_type': 'bearer', 'expires_in': 3599, 'access_token': 'ZpYJXQu88xgi6NgtzMjB5eo8jNURGUpJkWskemKwNqE.oHvHgWkUg50fdn1HcR1FukMeidgaAKrUM6dL46lSUZU', 'scope': 'openid'}
6.371 AccessTokenResponse {
    "access_token": "ZpYJXQu88xgi6NgtzMjB5eo8jNURGUpJkWskemKwNqE.oHvHgWkUg50fdn1HcR1FukMeidgaAKrUM6dL46lSUZU",
    "expires_in": 3599,
    "id_token": {
        "at_hash": "gtYE3SXIqSHpwgj_tP0rrA",
        "aud": [
            "2d12d5b7-cdac-40b2-92af-0d7eae866149"
        ],
        "auth_time": 1529751824,
        "c_hash": "0xq6VyUEW7exGjvgxlxXmg",
        "exp": 1529755537,
        "iat": 1529751938,
        "iss": "https://oidc-certification.ory.sh:8443/",
        "jti": "03be8693-cfdc-445f-aec8-93f5aa10b47d",
        "nonce": "KkvbhcodcfJzYZ88",
        "rat": 1529751933,
        "sub": "foo@bar.com"
    },
    "scope": "openid",
    "token_type": "bearer"
}
6.371 phase <--<-- 6 --- AccessToken -->-->
6.371 --> request op_args: {'state': 'XzfFpj7HlOY5mLtz'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61353/authz_cb'}
6.371 do_access_token_request kwargs:{'request_args': {'grant_type': 'authorization_code', 'state': 'XzfFpj7HlOY5mLtz', 'code': 'lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o', 'redirect_uri': 'https://op.certification.openid.net:61353/authz_cb', 'client_id': '2d12d5b7-cdac-40b2-92af-0d7eae866149'}, 'state': 'XzfFpj7HlOY5mLtz'}
6.371 AccessTokenRequest {
    "code": "lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61353/authz_cb",
    "state": "XzfFpj7HlOY5mLtz"
}
6.371 request_url https://oidc-certification.ory.sh:8443/oauth2/token
6.371 request_http_args {'headers': {'Authorization': 'Basic MmQxMmQ1YjctY2RhYy00MGIyLTkyYWYtMGQ3ZWFlODY2MTQ5OmlSa2ZUcHJFdHhNMw==', 'Content-Type': 'application/x-www-form-urlencoded'}}
6.371 request code=lOAK9v6m-fTIAQ8BmD4l6skeItwsZSLHlUC5neZEvNc.aBa5K8Wy65LkCTmvNXWewWdEVa6VauQLwBmv_gRKM_o&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61353%2Fauthz_cb&grant_type=authorization_code&state=XzfFpj7HlOY5mLtz
6.534 http response url:https://oidc-certification.ory.sh:8443/oauth2/token status_code:400 message:{"error":"invalid_grant","error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client","status_code":400,"error_debug":"The authorization code has already been used.Additionally, an error occurred during processing the refresh token revocation: Not found."}
6.535 response {'error_debug': 'The authorization code has already been used.Additionally, an error occurred during processing the refresh token revocation: Not found.', 'error_description': 'The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client', 'error': 'invalid_grant', 'status_code': 400}
6.535 event Got expected error
6.535 TokenErrorResponse {
    "error": "invalid_grant",
    "error_debug": "The authorization code has already been used.Additionally, an error occurred during processing the refresh token revocation: Not found.",
    "error_description": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client",
    "status_code": 400
}
6.535 phase <--<-- 7 --- UserInfo -->-->
6.535 do_user_info_request kwargs:{'state': 'XzfFpj7HlOY5mLtz', 'method': 'GET', 'authn_method': 'bearer_header'}
6.536 request {'body': None}
6.536 request_url https://oidc-certification.ory.sh:8443/userinfo
6.536 request_http_args {'headers': {'Authorization': 'Bearer ZpYJXQu88xgi6NgtzMjB5eo8jNURGUpJkWskemKwNqE.oHvHgWkUg50fdn1HcR1FukMeidgaAKrUM6dL46lSUZU'}}
6.611 http response url:https://oidc-certification.ory.sh:8443/userinfo status_code:401 message:{"error":"request_unauthorized","error_description":"The request could not be authorized","error_hint":"Check that you provided valid credentials in the right format.","status_code":401,"error_debug":"A validator returned an error"}

6.611 event Expected error not received: got request_unauthorized
6.611 ErrorResponse {
    "error": "request_unauthorized",
    "error_debug": "A validator returned an error",
    "error_description": "The request could not be authorized",
    "error_hint": "Check that you provided valid credentials in the right format.",
    "status_code": 401
}
6.611 ErrorResponse {
    "error": "request_unauthorized",
    "error_debug": "A validator returned an error",
    "error_description": "The request could not be authorized",
    "error_hint": "Check that you provided valid credentials in the right format.",
    "status_code": 401
}
6.611 phase <--<-- 8 --- Done -->-->
6.611 end 
6.612 assertion VerifyResponse
6.612 condition verify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
6.612 condition Done: status=OK



============================================================

Conditions

verify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
Done: status=OK



============================================================

RESULT: PASSED
