Test Info

Issuerhttps://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default
Profile[]
Test IDOP-OAuth-2nd
Test descriptionTrying to use authorization code twice should result in an error
Timestamp2019-09-11T08:22:38Z

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://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default'}
0http response
url:https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/.well-known/openid-configuration status_code:200
0ProviderConfigurationResponse
{
    "authorization_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/authorize",
    "claim_types_supported": [
        "normal"
    ],
    "claims_parameter_supported": true,
    "claims_supported": [
        "realmName",
        "preferred_username",
        "given_name",
        "uid",
        "upn",
        "groupIds",
        "employee_id",
        "name",
        "tenantId",
        "mobile_number",
        "department",
        "family_name",
        "job_title",
        "email"
    ],
    "device_authorization_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/device_authorization",
    "grant_types_supported": [
        "authorization_code",
        "implicit",
        "client_credentials",
        "password",
        "refresh_token",
        "urn:ietf:params:oauth:grant-type:device_code"
    ],
    "id_token_encryption_alg_values_supported": [
        "none"
    ],
    "id_token_encryption_enc_values_supported": [
        "none"
    ],
    "id_token_signing_alg_values_supported": [
        "none",
        "HS256",
        "HS384",
        "HS512",
        "RS256",
        "RS384",
        "RS512"
    ],
    "introspection_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/introspect",
    "issuer": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default",
    "jwks_uri": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/jwks",
    "request_object_encryption_alg_values_supported": [
        "none"
    ],
    "request_object_encryption_enc_values_supported": [
        "none"
    ],
    "request_object_signing_alg_values_supported": [
        "none"
    ],
    "request_parameter_supported": true,
    "request_uri_parameter_supported": false,
    "require_request_uri_registration": false,
    "response_modes_supported": [
        "query",
        "fragment",
        "form_post"
    ],
    "response_types_supported": [
        "code",
        "none",
        "token",
        "id_token",
        "token id_token",
        "code id_token",
        "code token",
        "code token id_token"
    ],
    "revocation_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/revoke",
    "scopes_supported": [
        "openid",
        "profile",
        "email",
        "phone"
    ],
    "subject_types_supported": [
        "public"
    ],
    "token_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/token",
    "token_endpoint_auth_methods_supported": [
        "client_secret_basic",
        "client_secret_post"
    ],
    "user_authorization_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/user_authorization",
    "userinfo_encryption_alg_values_supported": [
        "none"
    ],
    "userinfo_encryption_enc_values_supported": [
        "none"
    ],
    "userinfo_endpoint": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/userinfo",
    "userinfo_signing_alg_values_supported": [
        "none"
    ],
    "version": "3.0"
}
0phase<--<-- 2 --- Registration -->-->
0not expected to doDynamic registration
0phase<--<-- 3 --- Note -->-->
2phase<--<-- 4 --- AsyncAuthn -->-->
2AuthorizationRequest
{
    "client_id": "5525f670-e6b3-41a9-afec-add4254aff3b",
    "nonce": "pgsPOxWlwOfCzkZZ",
    "redirect_uri": "https://op.certification.openid.net:61906/authz_cb",
    "response_type": "code",
    "scope": "openid",
    "state": "fonbHxOONtrCig5e"
}
2redirect urlhttps://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/authorize?state=fonbHxOONtrCig5e&nonce=pgsPOxWlwOfCzkZZ&response_type=code&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61906%2Fauthz_cb&client_id=5525f670-e6b3-41a9-afec-add4254aff3b
2redirecthttps://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/authorize?state=fonbHxOONtrCig5e&nonce=pgsPOxWlwOfCzkZZ&response_type=code&scope=openid&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61906%2Fauthz_cb&client_id=5525f670-e6b3-41a9-afec-add4254aff3b
2responseResponse URL with query part
2response{'code': 'cSq1KdZbXuGbAJswQWKS4rMaVD0Da8', 'grant_id': '48221c4e-ba89-4308-9aa4-ecb0451c474c', 'state': 'fonbHxOONtrCig5e'}
2response{'code': 'cSq1KdZbXuGbAJswQWKS4rMaVD0Da8', 'grant_id': '48221c4e-ba89-4308-9aa4-ecb0451c474c', 'state': 'fonbHxOONtrCig5e'}
2AuthorizationResponse
{
    "code": "cSq1KdZbXuGbAJswQWKS4rMaVD0Da8",
    "grant_id": "48221c4e-ba89-4308-9aa4-ecb0451c474c",
    "state": "fonbHxOONtrCig5e"
}
2phase<--<-- 5 --- AccessToken -->-->
2requestop_args: {'state': 'fonbHxOONtrCig5e'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61906/authz_cb'}
2do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61906/authz_cb', 'code': 'cSq1KdZbXuGbAJswQWKS4rMaVD0Da8', 'state': 'fonbHxOONtrCig5e', 'grant_type': 'authorization_code', 'client_id': '5525f670-e6b3-41a9-afec-add4254aff3b'}, 'state': 'fonbHxOONtrCig5e', 'authn_method': 'client_secret_basic'}
2AccessTokenRequest
{
    "code": "cSq1KdZbXuGbAJswQWKS4rMaVD0Da8",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61906/authz_cb",
    "state": "fonbHxOONtrCig5e"
}
2request_urlhttps://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/token
2request_http_args{'headers': {'Authorization': 'Basic NTUyNWY2NzAtZTZiMy00MWE5LWFmZWMtYWRkNDI1NGFmZjNiOlRFOUwxY2wzdHc=', 'Content-Type': 'application/x-www-form-urlencoded'}}
2requestgrant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61906%2Fauthz_cb&code=cSq1KdZbXuGbAJswQWKS4rMaVD0Da8&state=fonbHxOONtrCig5e
3http response
url:https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/token status_code:200
3response{'access_token': 'HOskOXMcco6fe9DpRx4xd5ekolcrytzUHKmJprZ2', 'scope': 'openid', 'grant_id': '48221c4e-ba89-4308-9aa4-ecb0451c474c', 'id_token': 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InNlcnZlciJ9.eyJnaXZlbl9uYW1lIjoiSmFjb2IiLCJzX2hhc2giOiJENXpibFZxdVVxblptLTZRUzhXbUV3IiwidW5pcXVlU2VjdXJpdHlOYW1lIjoiNjQwMDA0S0ZPTyIsInRlbmFudElkIjoib2lkYy1wcm9kLWV1MDFhLXRlc3QxLmljZS5pYm1jbG91ZC5jb20iLCJtb2JpbGVfbnVtYmVyIjoiKzY1OTEwODUwOTEiLCJyZWFsbU5hbWUiOiJjbG91ZElkZW50aXR5UmVhbG0iLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJqYWNvYiIsIm5hbWUiOiJKYWNvYiBUZXN0ZXIiLCJub25jZSI6InBnc1BPeFdsd09mQ3prWloiLCJlbWFpbCI6InZzdzE5ODhAaG90bWFpbC5jb20iLCJhY3IiOiJ1cm46aWJtOnNlY3VyaXR5OnBvbGljeTppZDoxIiwidXNlclR5cGUiOiJyZWd1bGFyIiwiZGlzcGxheU5hbWUiOiJKYWNvYiBUZXN0ZXIiLCJmYW1pbHlfbmFtZSI6IlRlc3RlciIsImdyb3VwSWRzIjpbImFsbFVzZXJzIl0sImF0X2hhc2giOiJmWjEzV3gyRVZMdksxVE9Vb1dlMzRnIiwicGhvbmUyIjoiKzY1OTEwODUwOTEiLCJ1aWQiOiI2NDAwMDRLRk9PIiwiZXh0Ijp7InRlbmFudElkIjoib2lkYy1wcm9kLWV1MDFhLXRlc3QxLmljZS5pYm1jbG91ZC5jb20ifSwiaXNzIjoiaHR0cHM6Ly9vaWRjLXByb2QtZXUwMWEtdGVzdDEuaWNlLmlibWNsb3VkLmNvbS9vaWRjL2VuZHBvaW50L2RlZmF1bHQiLCJhdWQiOiI1NTI1ZjY3MC1lNmIzLTQxYTktYWZlYy1hZGQ0MjU0YWZmM2IiLCJzdWIiOiI2NDAwMDRLRk9PIiwiaWF0IjoxNTY4MTkwMTU4LCJleHAiOjE1NjgxOTczNTh9.WaMiTfL0CREKfaJ0figvFHFcdUKvdub1KuuRnuv1tjSkB0pI8WqJkCEbpUhVeQfxYKyGwuAiK0rmxw8Mn-hUm__sA3WDV0cODpnh6F31KGrocjraMUlOk913kaAUIsEMwsPTUGkEVhNslzr40HyZSTY-z9itwD2VmIhuxCuYoodMJLWTtc2TNwlKC1A34c405g5hUVeU-8xJeg6A1-wOKHIqgpdLa8aVwjDA1x1x8u00rplf3e3A81oEKn9TMiOnl6ex7a5w_xXWyt_gzvgwwx-cP2qIXkIMzXYd96b473YC28WxuF5JjmI3U4__Dllj0WVUg7MOEpKSta_3VUUDHA', 'token_type': 'Bearer', 'expires_in': 7199}
3AccessTokenResponse
{
    "access_token": "HOskOXMcco6fe9DpRx4xd5ekolcrytzUHKmJprZ2",
    "expires_in": 7199,
    "grant_id": "48221c4e-ba89-4308-9aa4-ecb0451c474c",
    "id_token": {
        "acr": "urn:ibm:security:policy:id:1",
        "at_hash": "fZ13Wx2EVLvK1TOUoWe34g",
        "aud": [
            "5525f670-e6b3-41a9-afec-add4254aff3b"
        ],
        "displayName": "Jacob Tester",
        "email": "vsw1988@hotmail.com",
        "exp": 1568197358,
        "ext": {
            "tenantId": "oidc-prod-eu01a-test1.ice.ibmcloud.com"
        },
        "family_name": "Tester",
        "given_name": "Jacob",
        "groupIds": [
            "allUsers"
        ],
        "iat": 1568190158,
        "iss": "https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default",
        "mobile_number": "+6591085091",
        "name": "Jacob Tester",
        "nonce": "pgsPOxWlwOfCzkZZ",
        "phone2": "+6591085091",
        "preferred_username": "jacob",
        "realmName": "cloudIdentityRealm",
        "s_hash": "D5zblVquUqnZm-6QS8WmEw",
        "sub": "640004KFOO",
        "tenantId": "oidc-prod-eu01a-test1.ice.ibmcloud.com",
        "uid": "640004KFOO",
        "uniqueSecurityName": "640004KFOO",
        "userType": "regular"
    },
    "scope": "openid",
    "token_type": "Bearer"
}
3jws header{'alg': 'RS256', 'typ': 'JWT', 'kid': 'server'}
3phase<--<-- 6 --- AccessToken -->-->
3requestop_args: {'state': 'fonbHxOONtrCig5e'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:61906/authz_cb'}
3do_access_token_request
kwargs:{'request_args': {'redirect_uri': 'https://op.certification.openid.net:61906/authz_cb', 'code': 'cSq1KdZbXuGbAJswQWKS4rMaVD0Da8', 'state': 'fonbHxOONtrCig5e', 'grant_type': 'authorization_code', 'client_id': '5525f670-e6b3-41a9-afec-add4254aff3b'}, 'state': 'fonbHxOONtrCig5e', 'authn_method': 'client_secret_basic'}
3AccessTokenRequest
{
    "code": "cSq1KdZbXuGbAJswQWKS4rMaVD0Da8",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:61906/authz_cb",
    "state": "fonbHxOONtrCig5e"
}
3request_urlhttps://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/token
3request_http_args{'headers': {'Authorization': 'Basic NTUyNWY2NzAtZTZiMy00MWE5LWFmZWMtYWRkNDI1NGFmZjNiOlRFOUwxY2wzdHc=', 'Content-Type': 'application/x-www-form-urlencoded'}}
3requestgrant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A61906%2Fauthz_cb&code=cSq1KdZbXuGbAJswQWKS4rMaVD0Da8&state=fonbHxOONtrCig5e
3http response
url:https://oidc-prod-eu01a-test1.ice.ibmcloud.com/oidc/endpoint/default/token status_code:400 message:{"error_description":"CSIAQ0158E The [authorization_grant] of type [authorization_code] does not exist or is invalid.","error":"invalid_grant"}
3response{'error_description': 'CSIAQ0158E The [authorization_grant] of type [authorization_code] does not exist or is invalid.', 'error': 'invalid_grant'}
3eventGot expected error
3TokenErrorResponse
{
    "error": "invalid_grant",
    "error_description": "CSIAQ0158E The [authorization_grant] of type [authorization_code] does not exist or is invalid."
}
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