curl -X POST -H "Authorization: Basic 12345" -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=refresh_token&refresh_token=12345' "https://apidev.oppenheimerfunds.com/oauth2/v2/token"
I get an error when the refresh_token is not in the correct format. A 400 BAD REQUEST "Server unable to read malformed syntax".
How do I write a custom error when receiving this 400 so that apigee returns the refresh_token to the client?
Thanks!
This might work
<AssignMessage name='AM-1'> <AssignTo createNew='false' transport='http' type='response'></AssignTo> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Set> <Payload contentType='application/json'>{ "bad_refresh_token" : "{request.formparam.refresh_token}" } <StatusCode>400</StatusCode> <ReasonPhrase>Bad Request</ReasonPhrase> </Set> </AssignMessage>
If the target is returning a 400,...You will need to make sure that policy ^^ runs in the fault rules....
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |