Hi Javier,
I was still unable to get authorization token.
I used the code only once within few seconds of getting it.
Below are the steps i followed.
1. Created a client dynamically.
Client details
{
"client_id": "@!B85C.7A16.4D72.EDFE!0001!99D2.4A78!0008!E0E5.C29D",
"client_secret": "7c770960-a3ad-4002-872e-c0a47ad3f8fd",
"registration_access_token": "94e0ed6d-d41f-4bc3-a9d0-75a483655723",
"registration_client_uri": "https://TPC-E17-13.phaedrus.sandvine.com/oxauth/seam/resource/restv1/oxauth/register?client_id=@!B85C.7A16.4D72.EDFE!0001!99D2.4A78!0008!E0E5.C29D",
"client_id_issued_at": 1454935569,
"client_secret_expires_at": 1455021969,
"redirect_uris": ["http://localhost"],
"response_types": [
"code",
"id_token",
"token"
],
"application_type": "native",
"client_name": "Dynamic Client Test 1",
"token_endpoint_auth_method": "client_secret_basic",
"subject_type": "public",
"id_token_signed_response_alg": "RS256",
"require_auth_time": false,
"post_logout_redirect_uris": ["http://localhost"],
"logout_uri": "",
"logout_session_required": false,
"scopes": [
"svScope",
"openid"
]
}
2. Request to get id_token and code
curl -v -k -u admin:JEpbCIJMuV3Q -X POST \
-d 'client_id=@!B85C.7A16.4D72.EDFE!0001!99D2.4A78!0008!E0E5.C29D' \
-d 'scope=svScope openid' \
-d 'response_type=id_token code' \
-d 'nonce=123232134' \
-d 'redirect_uri=http://localhost' \
'https://tpc-e17-13.phaedrus.sandvine.com/oxauth/seam/resource/restv1/oxauth/authorize'
Response
Location: http://localhost#session_id=a8161c57-0715-4f7d-9670-7a5fde3239fd&scope=openid+svScope&state&code=146a6fc4-8992-474e-836d-2370a353d0ad& id_token=eyJ0eXAiOiJKV1MiLCJhbGciOiJSUzI1NiIsImtpZCI6IjZmOTI0MTU0LTczYmQtNDRlNC1iNjI3LTUxNjEyY2ZmMjgyMiJ9.eyJpc3MiOiJodHRwczovL1RQQy1FMTctMTMucGhhZWRydXMuc2FuZHZpbmUuY29tIiwiYXVkIjoiQCFCODVDLjdBMTYuNEQ3Mi5FREZFITAwMDEhOTlEMi40QTc4ITAwMDghRTBFNS5DMjlEIiwiZXhwIjoxNDU0OTM5Mzg5LCJpYXQiOjE0NTQ5MzU3ODksIm5vbmNlIjoiMTIzMjMyMTM0IiwiYXV0aF90aW1lIjoxNDU0OTM1Nzg4LCJjX2hhc2giOiJ5bm5mZEFWdElQZjZ0R2JjYVUzVUx3Iiwib3hWYWxpZGF0aW9uVVJJIjoiaHR0cHM6Ly9UUEMtRTE3LTEzLnBoYWVkcnVzLnNhbmR2aW5lLmNvbS9veGF1dGgvb3BpZnJhbWUiLCJveE9wZW5JRENvbm5lY3RWZXJzaW9uIjoib3BlbmlkY29ubmVjdC0xLjAiLCJpbnVtIjoiQCFCODVDLjdBMTYuNEQ3Mi5FREZFITAwMDEhOTlEMi40QTc4ITAwMDAhQThGMi5ERTFFLkQ3RkIiLCJwcml2aWxlZ2VzIjoiQWxsIiwidXNlcl9uYW1lIjoiYWRtaW4iLCJzdWIiOiJAIUI4NUMuN0ExNi40RDcyLkVERkUhMDAwMSE5OUQyLjRBNzghMDAwMCFBOEYyLkRFMUUuRDdGQiJ9.ja4yym0PNHr3nmf5BqKaB1YDENf5D-ui-4oar9hwSUi-KZeH_wnvyEsn51LY452Aepz7eCsSdGT5eWqKxdJSPls9vW19uc4qKz8XYEjvU9w1ULu8vcl3PvsTdDGCoX2wSDl8eAtbvr2os_0MQJP3wUOs96C1MvfGfiicgKfxJ6IFAuVTb_uaqtsBvYazojnhrcCiKx059tX5FdSo1Jwv5dmb__CHrj5blto4ODdurA9ONCApVL5XSLTO785tXR0T6APHgiGEubSjwSBW763HexTbpmJ0svzMYc2SusttoShqfNI950e9GGxu2l_hyDJdV0dZmlkYyU1Bkn_HClQavA
3. Request to get authorization code
curl -v -k -X POST \
-d 'client_id=@!B85C.7A16.4D72.EDFE!0001!99D2.4A78!0008!E0E5.C29D' \
-d 'grant_type=authorization_code' \
-d 'code=146a6fc4-8992-474e-836d-2370a353d0ad' \
-d 'redirect_uri=http://localhost' \
'https://tpc-e17-13.phaedrus.sandvine.com/oxauth/seam/resource/restv1/oxauth/token'
Response
{"error":"invalid_grant","error_description":"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}
Regards,
Qasim