Authentication not working with multipart form data api request

Not applicable

Hi,

I have configured the verification policy as below

<VerifyAPIKey async="false" continueOnError="false" enabled="true" name="verify-api-key"> <DisplayName>Verify API Key</DisplayName> <APIKey ref="request.formparam.apikey"/> </VerifyAPIKey>

And I am always getting below error, when I am making api call

{ "fault": { "faultstring": "Failed to resolve API Key variable request.formparam.apikey", "detail": { "errorcode": "steps.oauth.v2.FailedToResolveAPIKey" } } }

Pls help

screen-shot-2016-06-08-at-123103-pm.png

0 4 750
4 REPLIES 4

@jeevan ,

Are you sending API Key in your request as formparam ? Is your generated API key includes API Product which in turn has above proxy access ?

Not applicable

@Anil Sagar Yes I am sending api key in form parameter only. Yes It has necessary permissions to access.Pls find the attached screenshot above.

The above said key verification worked perfectly if the content-type is "x-www-form-urlencoded"

Thanks,

Not applicable

It would be great if some one can suggest how to proceed on this?

hanks

As you have mentioned you need to use the Content-Type: x-www-form-urlencoded to get it working. form-data is typically used to attach and send files/binary content to a server. Check here