Test Info

Test descriptionTrying to use authorization code twice should result in an error
Profile[]
Test IDOP-OAuth-2nd
Timestamp2017-12-18T21:07:19Z
Issuerhttps://oidctest.idautoengineering.net/idp

Conditions


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

Trace Output

0.0phase<--<-- 0 --- Webfinger -->-->
0.0not expected to doWebFinger
0.0phase<--<-- 1 --- Discovery -->-->
0.0provider_config
kwargs:{'issuer': 'https://oidctest.idautoengineering.net/idp'}
0.024http response
url:https://oidctest.idautoengineering.net/idp/.well-known/openid-configuration status_code:200
0.025ProviderConfigurationResponse
{
    "authorization_endpoint": "https://oidctest.idautoengineering.net/idp/profile/oidc/auth",
    "claim_types_supported": [
        "normal"
    ],
    "claims_parameter_supported": false,
    "claims_supported": [
        "sub",
        "name",
        "given_name",
        "family_name",
        "email"
    ],
    "display_values_supported": [
        "page"
    ],
    "grant_types_supported": [
        "authorization_code"
    ],
    "id_token_signing_alg_values_supported": [
        "RS256"
    ],
    "issuer": "https://oidctest.idautoengineering.net/idp",
    "jwks_uri": "https://oidctest.idautoengineering.net/idp/profile/oidc/jwks",
    "request_parameter_supported": false,
    "request_uri_parameter_supported": true,
    "require_request_uri_registration": true,
    "response_modes_supported": [
        "query"
    ],
    "response_types_supported": [
        "code",
        "token",
        "id_token"
    ],
    "scopes_supported": [
        "openid"
    ],
    "subject_types_supported": [
        "public"
    ],
    "token_endpoint": "https://oidctest.idautoengineering.net/idp/profile/oidc/token",
    "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "client_secret_basic"
    ],
    "userinfo_endpoint": "https://oidctest.idautoengineering.net/idp/profile/oidc/userinfo",
    "userinfo_signing_alg_values_supported": [
        "RS256"
    ],
    "version": "3.0"
}
0.025phase<--<-- 2 --- Registration -->-->
0.025not expected to doDynamic registration
0.025phase<--<-- 3 --- Note -->-->
7.591phase<--<-- 4 --- AsyncAuthn -->-->
7.591AuthorizationRequest
{
    "client_id": "3000badf0c55d2cae7c22b3d63e3f667",
    "nonce": "OmHxehnDIca1nCIB",
    "redirect_uri": "https://op.certification.openid.net:60992/authz_cb",
    "response_type": "code",
    "scope": "openid",
    "state": "QgcCbwiDNoPbHO3E"
}
7.592redirect urlhttps://oidctest.idautoengineering.net/idp/profile/oidc/auth?scope=openid&nonce=OmHxehnDIca1nCIB&state=QgcCbwiDNoPbHO3E&response_type=code&client_id=3000badf0c55d2cae7c22b3d63e3f667&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A60992%2Fauthz_cb
7.592redirecthttps://oidctest.idautoengineering.net/idp/profile/oidc/auth?scope=openid&nonce=OmHxehnDIca1nCIB&state=QgcCbwiDNoPbHO3E&response_type=code&client_id=3000badf0c55d2cae7c22b3d63e3f667&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A60992%2Fauthz_cb
7.871response{'code': '_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9', 'state': 'QgcCbwiDNoPbHO3E'}
7.872response{'code': '_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9', 'state': 'QgcCbwiDNoPbHO3E'}
7.872AuthorizationResponse
{
    "code": "_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9",
    "state": "QgcCbwiDNoPbHO3E"
}
7.872phase<--<-- 5 --- AccessToken -->-->
7.872requestop_args: {'state': 'QgcCbwiDNoPbHO3E'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:60992/authz_cb'}
7.872do_access_token_request
kwargs:{'request_args': {'code': '_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9', 'state': 'QgcCbwiDNoPbHO3E', 'grant_type': 'authorization_code', 'client_id': '3000badf0c55d2cae7c22b3d63e3f667', 'redirect_uri': 'https://op.certification.openid.net:60992/authz_cb'}, 'state': 'QgcCbwiDNoPbHO3E'}
7.872AccessTokenRequest
{
    "client_id": "3000badf0c55d2cae7c22b3d63e3f667",
    "code": "_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:60992/authz_cb",
    "state": "QgcCbwiDNoPbHO3E"
}
7.873request_urlhttps://oidctest.idautoengineering.net/idp/profile/oidc/token
7.873request_http_args{'headers': {'Authorization': 'Basic MzAwMGJhZGYwYzU1ZDJjYWU3YzIyYjNkNjNlM2Y2Njc6ODY5N2E4OTlhYzFjNzYwODAyNmM4ZDEzN2E1YzMzYTAwM2RlMDA1MDc2MzBmMmQ2OGM5NTNlMTNkNzVlNjFiYg==', 'Content-Type': 'application/x-www-form-urlencoded'}}
7.873requestclient_id=3000badf0c55d2cae7c22b3d63e3f667&state=QgcCbwiDNoPbHO3E&code=_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A60992%2Fauthz_cb
7.905http response
url:https://oidctest.idautoengineering.net/idp/profile/oidc/token status_code:200
7.906response{'refresh_token': 'uDNxq8EQM7cL~~Uo5rrV2KH4ZIxF-7ZtmdrpFbe0xzvS5YFLpA', 'expires_in': 32399, 'scope': 'openid', 'access_token': 'ZA2Ua8UtWYJ~Z/gkCVh3M_RoUWk7u9vYl/hGg-vPnWyaH8cTvO', 'id_token': 'eyJraWQiOiI2NTJlNjk1N2UxNzNmYzYxOTYxN2ZhMjNjMzZjYmFjNTRhNWZhNzhlNjBiNzA2Mjg5NmI2ZDgzNTdkNDVhOWYxIiwiYWxnIjoiUlMyNTYifQ.eyJpYXQiOjE1MTM2MzEyMzksImV4cCI6MTUxMzYzMTI5OSwiaXNzIjoiaHR0cHM6Ly9vaWRjdGVzdC5pZGF1dG9lbmdpbmVlcmluZy5uZXQvaWRwIiwiYXVkIjoiMzAwMGJhZGYwYzU1ZDJjYWU3YzIyYjNkNjNlM2Y2NjciLCJzdWIiOiIyNjIwMjdhMC1hZjc3LTExZTctODc2ZC0wMjc0MGM1NDljY2EiLCJhdXRoX3RpbWUiOjE1MTM2MzEyMTUsIm5vbmNlIjoiT21IeGVobkRJY2ExbkNJQiIsImF6cCI6IjMwMDBiYWRmMGM1NWQyY2FlN2MyMmIzZDYzZTNmNjY3IiwibmFtZSI6IlN5c3RlbSBBZG1pbiIsImdpdmVuX25hbWUiOiJTeXN0ZW0iLCJmYW1pbHlfbmFtZSI6IkFkbWluIiwiZW1haWwiOiJqYmVsbGFzc2FpQGlkZW50aXR5YXV0b21hdGlvbi5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXRfaGFzaCI6IjhicFp2Q1dVSHkyT2N1ZkxaQVNiMWc9PSJ9.axbhB1qa0dYUgWsqqCxJXAsjBU6WXoboQ2OZmpUwiFJpzRn-6CXBKtYbyDrE4L6A0nwfLgyz-byWIiviaZRQstgC9LMWFfLcvGVlFu9wbJdUvAxVLgIwkohg6sCjlNSys8fbwvZxtoDfjy_hja4n9YlqXJ0CXt8DRAzsN41eP8TkncFijtWLEp21zrjNYG35ToSvnOmgNPv-RLVFyxge8Or7CYngscMvqE7hcgFpBrWXVBJM_AgaJzFC95Fx1MpTHcHNR-hwlvdZZjWGoGpWN-rB_TunCdMkgYWyp-AieO726XUO7YKXDrmXD2fjE4g6F8cFgjPAL5FXEe1fWSG_8A', 'token_type': 'Bearer'}
7.931AccessTokenResponse
{
    "access_token": "ZA2Ua8UtWYJ~Z/gkCVh3M_RoUWk7u9vYl/hGg-vPnWyaH8cTvO",
    "expires_in": 32399,
    "id_token": {
        "at_hash": "8bpZvCWUHy2OcufLZASb1g==",
        "aud": [
            "3000badf0c55d2cae7c22b3d63e3f667"
        ],
        "auth_time": 1513631215,
        "azp": "3000badf0c55d2cae7c22b3d63e3f667",
        "email": "jbellassai@identityautomation.com",
        "email_verified": true,
        "exp": 1513631299,
        "family_name": "Admin",
        "given_name": "System",
        "iat": 1513631239,
        "iss": "https://oidctest.idautoengineering.net/idp",
        "name": "System Admin",
        "nonce": "OmHxehnDIca1nCIB",
        "sub": "262027a0-af77-11e7-876d-02740c549cca"
    },
    "refresh_token": "uDNxq8EQM7cL~~Uo5rrV2KH4ZIxF-7ZtmdrpFbe0xzvS5YFLpA",
    "scope": "openid",
    "token_type": "Bearer"
}
7.932phase<--<-- 6 --- AccessToken -->-->
7.932requestop_args: {'state': 'QgcCbwiDNoPbHO3E'}, req_args: {'redirect_uri': 'https://op.certification.openid.net:60992/authz_cb'}
7.932do_access_token_request
kwargs:{'request_args': {'code': '_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9', 'state': 'QgcCbwiDNoPbHO3E', 'grant_type': 'authorization_code', 'client_id': '3000badf0c55d2cae7c22b3d63e3f667', 'redirect_uri': 'https://op.certification.openid.net:60992/authz_cb'}, 'state': 'QgcCbwiDNoPbHO3E'}
7.932AccessTokenRequest
{
    "client_id": "3000badf0c55d2cae7c22b3d63e3f667",
    "code": "_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9",
    "grant_type": "authorization_code",
    "redirect_uri": "https://op.certification.openid.net:60992/authz_cb",
    "state": "QgcCbwiDNoPbHO3E"
}
7.932request_urlhttps://oidctest.idautoengineering.net/idp/profile/oidc/token
7.932request_http_args{'headers': {'Authorization': 'Basic MzAwMGJhZGYwYzU1ZDJjYWU3YzIyYjNkNjNlM2Y2Njc6ODY5N2E4OTlhYzFjNzYwODAyNmM4ZDEzN2E1YzMzYTAwM2RlMDA1MDc2MzBmMmQ2OGM5NTNlMTNkNzVlNjFiYg==', 'Content-Type': 'application/x-www-form-urlencoded'}}
7.932requestclient_id=3000badf0c55d2cae7c22b3d63e3f667&state=QgcCbwiDNoPbHO3E&code=_QYUOt8CnBWKUvROvJHndqKqQaVyzNWq38f.Nnd7INx5Q9FfG9&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fop.certification.openid.net%3A60992%2Fauthz_cb
7.971http response
url:https://oidctest.idautoengineering.net/idp/profile/oidc/token status_code:400 message:{
  "error" : "invalid_grant",
  "error_description" : "The authorization code is not valid"
}
7.971response{'error_description': 'The authorization code is not valid', 'error': 'invalid_grant'}
7.971eventGot expected error
7.971TokenErrorResponse
{
    "error": "invalid_grant",
    "error_description": "The authorization code is not valid"
}
7.971phase<--<-- 7 --- Done -->-->
7.971end
7.972assertionVerifyResponse
7.972conditionverify-response: status=OK [Checks that the last response was one of a possible set of OpenID Connect Responses]
7.972conditionDone: status=OK

Result

PASSED