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-18T04:23:06Z

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_encryption_alg_values_supported": [
        "A128KW"
    ],
    "id_token_encryption_enc_values_supported": [
        "A128CBC-HS256"
    ],
    "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 -->-->
0phase<--<-- 4 --- AsyncAuthn -->-->
0AuthorizationRequest
{
    "client_id": "clientID",
    "nonce": "e9KJ1ClMAcRLwV2Z",
    "redirect_uri": "https://op.certification.openid.net:61771/authz_cb",
    "response_type": "code token",
    "scope": "openid",
    "state": "7n3XnYOrEanQawxM"
}
0redirect urlhttps://isamfed.com:30443/mga/sps/oauth/oauth20/authorize?state=7n3XnYOrEanQawxM&nonce=e9KJ1ClMAcRLwV2Z&response_type=code+token&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61771%2Fauthz_cb&client_id=clientID
0redirecthttps://isamfed.com:30443/mga/sps/oauth/oauth20/authorize?state=7n3XnYOrEanQawxM&nonce=e9KJ1ClMAcRLwV2Z&response_type=code+token&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61771%2Fauthz_cb&client_id=clientID
1http args{}
1responseURL with fragment
1responseaccess_token=ZgJQ12UCFjOP4VKa4V6Q&state=7n3XnYOrEanQawxM&expires_in=3599&token_type=bearer&code=5P33v5KLvaiUckiF17N4DD8nqYyzCH&scope=openid
1response{'access_token': 'ZgJQ12UCFjOP4VKa4V6Q', 'state': '7n3XnYOrEanQawxM', 'expires_in': 3599, 'token_type': 'bearer', 'code': '5P33v5KLvaiUckiF17N4DD8nqYyzCH', 'scope': 'openid'}
1AuthorizationResponse
{
    "access_token": "ZgJQ12UCFjOP4VKa4V6Q",
    "code": "5P33v5KLvaiUckiF17N4DD8nqYyzCH",
    "expires_in": 3599,
    "scope": "openid",
    "state": "7n3XnYOrEanQawxM",
    "token_type": "bearer"
}
1phase<--<-- 5 --- AccessToken -->-->
1requestop_args: {'state': '7n3XnYOrEanQawxM'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61771/authz_cb'}
1do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61771/authz_cb', 'code': '5P33v5KLvaiUckiF17N4DD8nqYyzCH', 'state': '7n3XnYOrEanQawxM', 'grant_type': 'authorization_code', 'client_id': 'clientID'}, 'state': '7n3XnYOrEanQawxM', 'authn_method': 'client_secret_basic'}
1AccessTokenRequest
{
    "code": "5P33v5KLvaiUckiF17N4DD8nqYyzCH",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61771/authz_cb",
    "state": "7n3XnYOrEanQawxM"
}
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%3A61771%2Fauthz_cb&code=5P33v5KLvaiUckiF17N4DD8nqYyzCH&state=7n3XnYOrEanQawxM
2http response
url:https://isamfed.com:30443/mga/sps/oauth/oauth20/token status_code:200
2response{'access_token': 'Sy3DgXyE1UXnAKOqkvtd', 'refresh_token': '7pfgmtsivNBc58yxFwh1vsVO4fH2RjswEOCAKfSx', 'scope': 'openid', 'id_token': 'eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JD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4cpi1aMqEvzQ', 'token_type': 'bearer', 'expires_in': 3599}
2AccessTokenResponse
{
    "access_token": "Sy3DgXyE1UXnAKOqkvtd",
    "expires_in": 3599,
    "id_token": {
        "at_hash": "6jghIXkQcFJr4ouAkF7WIg",
        "aud": [
            "clientID"
        ],
        "exp": 1560835205,
        "iat": 1560831785,
        "iss": "https://isamfed.com:30443/test",
        "nonce": "e9KJ1ClMAcRLwV2Z",
        "rt_hash": "zJrL1I5A2lgQg6Inlj8Oig",
        "sub": "testuser"
    },
    "refresh_token": "7pfgmtsivNBc58yxFwh1vsVO4fH2RjswEOCAKfSx",
    "scope": "openid",
    "token_type": "bearer"
}
2jws header{'kid': '_uhPdeGrTWxobFeH0XbzjJpRrzp3CB9nknx1yFV1G-0', 'alg': 'RS256'}
2jwe header{'alg': 'A128KW', 'enc': 'A128CBC-HS256', 'cty': 'JWT'}
2phase<--<-- 6 --- AccessToken -->-->
2requestop_args: {'state': '7n3XnYOrEanQawxM'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61771/authz_cb'}
2do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61771/authz_cb', 'code': '5P33v5KLvaiUckiF17N4DD8nqYyzCH', 'state': '7n3XnYOrEanQawxM', 'grant_type': 'authorization_code', 'client_id': 'clientID'}, 'state': '7n3XnYOrEanQawxM', 'authn_method': 'client_secret_basic'}
2AccessTokenRequest
{
    "code": "5P33v5KLvaiUckiF17N4DD8nqYyzCH",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61771/authz_cb",
    "state": "7n3XnYOrEanQawxM"
}
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%3A61771%2Fauthz_cb&code=5P33v5KLvaiUckiF17N4DD8nqYyzCH&state=7n3XnYOrEanQawxM
3http 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"}
3response{'error_description': 'FBTOAU211E The [authorization_grant] received of type [authorization_code] does not exist.', 'error': 'invalid_grant'}
3eventGot expected error
3TokenErrorResponse
{
    "error": "invalid_grant",
    "error_description": "FBTOAU211E The [authorization_grant] received of type [authorization_code] does not exist."
}
3phase<--<-- 7 --- Done -->-->
3end
3assertionCheckHTTPErrorResponse
3conditioncheck-http-error-response: status=OK [Checks that an error code is either 400 or 401 which are the only ones accepted by OAuth2/OIDC.]
3assertionVerifyResponse
3conditionverify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
3conditionDone: status=OK

Result

PASSED