Test Info

Issuerhttps://isamfed.com:30443/test
Profile[]
Test IDOP-OAuth-2nd
Test descriptionTrying to use authorization code twice should result in an error
Timestamp2019-06-17T07:59:25Z

Conditions


check-http-error-response: status=OK [Checks that an error code is either 400 or 401 which are the only ones accepted by OAuth2/OIDC.]
verify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
Done: status=OK

Trace Output

0phase<--<-- 0 --- Webfinger -->-->
0not expected to doWebFinger
0phase<--<-- 1 --- Discovery -->-->
0provider_config
kwargs:{'issuer': 'https://isamfed.com:30443/test'}
0http response
url:https://isamfed.com:30443/test/.well-known/openid-configuration status_code:200
0ProviderConfigurationResponse
{
    "authorization_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/authorize",
    "claims_parameter_supported": false,
    "claims_supported": [
        "realmName",
        "preferred_username",
        "given_name",
        "uid",
        "upn",
        "groupIds",
        "employee_id",
        "name",
        "tenantId",
        "mobile_number",
        "department",
        "job_title",
        "family_name",
        "email"
    ],
    "device_authorize_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/device_authorize",
    "grant_types_supported": [
        "urn:ietf:params:oauth:grant-type:jwt-bearer",
        "implicit",
        "urn:ietf:params:oauth:grant-type:saml2-bearer",
        "urn:ietf:params:oauth:grant-type:device_code",
        "client_credentials",
        "password",
        "authorization_code",
        "refresh_token"
    ],
    "id_token_signing_alg_values_supported": [
        "RS256"
    ],
    "introspect_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/introspect",
    "issuer": "https://isamfed.com:30443/test",
    "jwks_uri": "https://isamfed.com:30443/mga/sps/jwks",
    "name": "OIDCDefinition",
    "poc": "https://isamfed.com:30443/mga/",
    "registration_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/register/OIDCDefinition",
    "request_parameter_supported": true,
    "request_uri_parameter_supported": true,
    "require_request_uri_registration": false,
    "response_modes_supported": [
        "fragment",
        "form_post"
    ],
    "response_types_supported": [
        "token",
        "id_token",
        "token id_token",
        "code",
        "code id_token",
        "code token id_token",
        "code token",
        "none"
    ],
    "revocation_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/revoke",
    "subject_types_supported": [
        "public"
    ],
    "token_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/token",
    "token_endpoint_auth_methods_supported": [
        "private_key_jwt",
        "client_secret_post",
        "client_secret_basic"
    ],
    "user_authorize_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/user_authorize",
    "userinfo_endpoint": "https://isamfed.com:30443/mga/sps/oauth/oauth20/userinfo",
    "userinfo_signing_alg_values_supported": [
        "RS256"
    ],
    "version": "3.0"
}
0phase<--<-- 2 --- Registration -->-->
0not expected to doDynamic registration
0phase<--<-- 3 --- Note -->-->
1phase<--<-- 4 --- AsyncAuthn -->-->
1AuthorizationRequest
{
    "client_id": "clientID",
    "nonce": "hgWwEGQTHUpC0vqe",
    "redirect_uri": "https://op.certification.openid.net:61375/authz_cb",
    "response_type": "code",
    "scope": "openid",
    "state": "a30qQA8Dq1iw8Ed0"
}
1redirect urlhttps://isamfed.com:30443/mga/sps/oauth/oauth20/authorize?state=a30qQA8Dq1iw8Ed0&nonce=hgWwEGQTHUpC0vqe&response_type=code&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61375%2Fauthz_cb&client_id=clientID
1redirecthttps://isamfed.com:30443/mga/sps/oauth/oauth20/authorize?state=a30qQA8Dq1iw8Ed0&nonce=hgWwEGQTHUpC0vqe&response_type=code&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61375%2Fauthz_cb&client_id=clientID
1responseResponse URL with query part
1response{'state': 'a30qQA8Dq1iw8Ed0', 'code': 'pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO'}
1response{'state': 'a30qQA8Dq1iw8Ed0', 'code': 'pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO'}
1AuthorizationResponse
{
    "code": "pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO",
    "state": "a30qQA8Dq1iw8Ed0"
}
1phase<--<-- 5 --- AccessToken -->-->
1requestop_args: {'state': 'a30qQA8Dq1iw8Ed0'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61375/authz_cb'}
1do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61375/authz_cb', 'code': 'pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO', 'state': 'a30qQA8Dq1iw8Ed0', 'grant_type': 'authorization_code', 'client_id': 'clientID'}, 'state': 'a30qQA8Dq1iw8Ed0', 'authn_method': 'client_secret_basic'}
1AccessTokenRequest
{
    "code": "pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61375/authz_cb",
    "state": "a30qQA8Dq1iw8Ed0"
}
1request_urlhttps://isamfed.com:30443/mga/sps/oauth/oauth20/token
1request_http_args{'headers': {'Authorization': 'Basic Y2xpZW50SUQ6Y2xpZW50U2VjcmV0', 'Content-Type': 'application/x-www-form-urlencoded'}}
1requestgrant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61375%2Fauthz_cb&code=pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO&state=a30qQA8Dq1iw8Ed0
2http response
url:https://isamfed.com:30443/mga/sps/oauth/oauth20/token status_code:200
2response{'access_token': '1sb0K538mdeK0dXxmwLD', 'refresh_token': 'tGSRYannI77we9uJR5wxTXKHCbiyVX1qhC8jbAvT', 'scope': 'openid', 'id_token': 'eyJraWQiOiJfdWhQZGVHclRXeG9iRmVIMFhiempKcFJyenAzQ0I5bmtueDF5RlYxRy0wIiwiYWxnIjoiUlMyNTYifQ.eyJydF9oYXNoIjoiT1l1aThQVFFZSEVWc2tOazZranBnZyIsIm5vbmNlIjoiaGdXd0VHUVRIVXBDMHZxZSIsImlhdCI6MTU2MDc1ODM2NSwiaXNzIjoiaHR0cHM6Ly9pc2FtZmVkLmNvbTozMDQ0My90ZXN0IiwiYXRfaGFzaCI6IndRc1B5RWpDc2ZTLWREY3gtNlIxbmciLCJzdWIiOiJ0ZXN0dXNlciIsImV4cCI6MTU2MDc2MTc4NSwiYXVkIjoiY2xpZW50SUQifQ.xTXHqJZPHpnsI8ezPNFtjPw2u1tH4RWRQxjVvKUuiGExJvAdjeSpPNn3_xfoB8yMqUdhOYoBcGAJCawYEdXtj35ijXlprQMmIjH6GA2YbbFJzPibjW_r80G9Lzr2su-AtdMxnRgVyi92U6g6e-e1CDlEwjkEzRkx6tXKKNXzR79Od8_GCTSEy0sxSUIRPVBkXwNO5bLPOwZV0UYgeX_wntzKOzzlROHh_Yd1NVUWLFz5DT7FgnIs1qMC3cOrwEQVkXYG34dIhBJhkGN_7BcFcq8mF3xqpCv7-PcePDVF6elJj_rFrFuaUJ5QDY4Ta5yF0pWFxDMQfSFLBsUUtvwK0w', 'token_type': 'bearer', 'expires_in': 3599}
2AccessTokenResponse
{
    "access_token": "1sb0K538mdeK0dXxmwLD",
    "expires_in": 3599,
    "id_token": {
        "at_hash": "wQsPyEjCsfS-dDcx-6R1ng",
        "aud": [
            "clientID"
        ],
        "exp": 1560761785,
        "iat": 1560758365,
        "iss": "https://isamfed.com:30443/test",
        "nonce": "hgWwEGQTHUpC0vqe",
        "rt_hash": "OYui8PTQYHEVskNk6kjpgg",
        "sub": "testuser"
    },
    "refresh_token": "tGSRYannI77we9uJR5wxTXKHCbiyVX1qhC8jbAvT",
    "scope": "openid",
    "token_type": "bearer"
}
2jws header{'kid': '_uhPdeGrTWxobFeH0XbzjJpRrzp3CB9nknx1yFV1G-0', 'alg': 'RS256'}
2phase<--<-- 6 --- AccessToken -->-->
2requestop_args: {'state': 'a30qQA8Dq1iw8Ed0'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61375/authz_cb'}
2do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61375/authz_cb', 'code': 'pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO', 'state': 'a30qQA8Dq1iw8Ed0', 'grant_type': 'authorization_code', 'client_id': 'clientID'}, 'state': 'a30qQA8Dq1iw8Ed0', 'authn_method': 'client_secret_basic'}
2AccessTokenRequest
{
    "code": "pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61375/authz_cb",
    "state": "a30qQA8Dq1iw8Ed0"
}
2request_urlhttps://isamfed.com:30443/mga/sps/oauth/oauth20/token
2request_http_args{'headers': {'Authorization': 'Basic Y2xpZW50SUQ6Y2xpZW50U2VjcmV0', 'Content-Type': 'application/x-www-form-urlencoded'}}
2requestgrant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61375%2Fauthz_cb&code=pMwXPHbQc8lL2CHKbZ2GnTqFyhGmQO&state=a30qQA8Dq1iw8Ed0
2http response
url:https://isamfed.com:30443/mga/sps/oauth/oauth20/token status_code:400 message:{"error_description":"FBTOAU211E The [authorization_grant] received of type [authorization_code] does not exist.","error":"invalid_grant"}
2response{'error_description': 'FBTOAU211E The [authorization_grant] received of type [authorization_code] does not exist.', 'error': 'invalid_grant'}
2eventGot expected error
2TokenErrorResponse
{
    "error": "invalid_grant",
    "error_description": "FBTOAU211E The [authorization_grant] received of type [authorization_code] does not exist."
}
2phase<--<-- 7 --- Done -->-->
2end
2assertionCheckHTTPErrorResponse
2conditioncheck-http-error-response: status=OK [Checks that an error code is either 400 or 401 which are the only ones accepted by OAuth2/OIDC.]
2assertionVerifyResponse
2conditionverify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
2conditionDone: status=OK

Result

PASSED