I have a custom mediator which obtains the endpoint url from message context property ENDPOINT_PREFIX.
I am trying to do the same in my authentication handler, but the get property returns null.
Is there a different way to obtain this information inside a custom handler?
Note that I am not after the endpoint itself (e.g. /api/1.0.0) but after the url to which it points to (in the publisher ui it appears as production/sandbox url).
Related
I have a custom authentication handler in which I need to figure out the HTTP_METHOD.
In my custom mediators I can get this easily from the synapse context, from api.ui.HTTP_METHOD property. For example
api.ut.HTTP_METHOD ==> POST
But I do not have this property in my custom authentication handler. Is there another way to get hold on the HTTP METHOD of the API inside a custom authentication handler?
In a custom handler, you have access to the message context. Using that message context , you can retrieve HTTP_METHOD like below.
((Axis2MessageContext) messageContext).getAxis2MessageContext().get‌Property("HTTP_METHOD")
Can refer Writing Custom Handlers and Axis2 Java doc for more info.
I am trying to pass the endpoint for a project using the project custom properties. Say I created a custom property "EndPoint" and am trying to pass http://${#Project#EndPoint} in the endpoint field for the get request, it is throwing me null response. The request sent is not having the endpoint value.
GET http://null///int/locations/v1/destinations?
Should we able to override the properties?
I am using WSO2 API Gateway to service API calls. The backend requires custom user attributes (username, e-mail, etc.) to be sent as part of the query string in the URL. The values for the query string pairs will be provided in the SAML2 token embedded in the API call.
How can a mediator access these custom SAML2 attributes?
You can create a custom mediator or custom handler to parse the saml token and set it to a header or something . see Writing Custom+Handlers for sample handler which reads a header .
I'm trying to integrate payment gateway with wso2 api manager.I'm following wso2 documentation. According to this documentation "If you need to redirect back to the API Manager, call the workflow call back service to complete the workflow. To invoke this service, set the callback URL and the workflow reference ID in the additional parameters"
what exactly is the call back url here. and how to make subscription complete after payment is successfull. i.e to call complete method??
Callback URL is a link which will be invoked by API method after its work is done. Here callback url is the additional parameter according to the API documentation. You need to set this field with the page where you want to redirect your client after payment.
How to send the post request in wso2 api manager? What would be the content type, parameters etc.
I am publishing Rest APIs in WSO2 API Manager , I would like to intercept my own API input field validations for each API like input parameter format and value etc. If validation success then API Manager should allow the request to invoke back-end , else reject the request with error message.
You can create a custom handler or custom sequence and deploy it for that api. You can implement the validation logic inside that.
see following product documentation
https://docs.wso2.com/display/AM1100/Writing+Custom+Handlers
https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions