WSO2 /token resource not found - wso2-api-manager

I'm trying to get a token to use in a call to a service published through WSO2 API Gateway and for that I'm calling the /token resource on https://:8243/token with a POST method and "grant_type=client credentials" and the correct Authorization header but the server returns 404 resource /token not available
If I use the Curl call generated using the "store" application I get the same error.
If I use the resource through the carbon application everything works though, I make the call to https://:9443/oauth2/token and I get the token back
Could anybody help me getting the application on the 8243 port to work?
Thanks

apimanger serves https api calls in port 8243 and http api call in port 8280 and it is defined under transportReceiver in the axis2.xml /repository/conf/axis2/axis2.xml).
Even though it is listening 8243 , if that port is not opened to outside from your server, then you will not be able to access via port 8243.So
Check whether port 8243 is opened in your server where apimanger gateway runs .You can use telnet command and check whether you are able to connect to it.

Check if in < APIM > /repository/deployment/server/synapse-configs/default/api you find the _ TokenAPI _ .xml
I had the same issue and found the file renamed with .back. Removing the .back extension and restarting the server worked.

Related

Binding web address to localhost

I'm trying to implement a card payment provider to my web shop, but it only accepts a real URLs as success, error and cancel callbacks. For example, the success callback should be https://www.mywebshop.com/Checkout/PaymentSuccessful
As I want to test the mentioned functionality locally, I need to set the payment success callback to https://localhost:44328/Checkout/PaymentSuccessful, but the card payment provider don't accept it (it redirects to error callback instantly).
So, I guess I should add following rows to my hosts file:
127.0.0.1 mywebshop.com
127.0.0.1 www.mywebshop.com
Unfortunately, that didn't work - the local app is running but when I request mywebshop.com, I got messages below (I also tried with https/http/www)
This site can’t be reached
mywebshop.com refused to connect.
When I add a port, like https://mywebshop.com:44328/, I got error:
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
If I add following binding to my applicationhost.config, nothing changes.
<binding protocol="https" bindingInformation="*:44328:mywebshop.com" />
<binding protocol="https" bindingInformation="*:44328:www.mywebshop.com" />
I also tried adding URL reservations with netsh, but it was unsuccessful.
You can use Ngrok for your testing. Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Please check how it works page here and its documentation here. Their free plan is sufficient for testing.
So download ngrok and run the ngrok.exe. Run below command which will give you public url - something like http://4a950b92.ngrok.io/ which will point to your local site. Hopefully that will solve your problem.
ngrok http -host-header=localhost 8080

Getting '405 Not Allowed' for PUT/POST Methods in postman in mule 4

I have created a mule application with client_id and client_secret, TLS keystore and deployed on cloudhub. I am able to run application locally but cannot run with cloudhub url.
URL: https://system.us-e2.cloudhub.io/api/refund with PUT method with json body.
It is throwing '405 Not Allowed'
Thanks in advance
Probably you are not pointing to the right application. The error is coming from CloudHub load balancer, indicating that it didn't reach your application. Check that the URL used is the right one for the application. Also that the application is listening in the right port. For CloudHub an HTTPS listening application has to listen in port 8082.
You can try to troubleshoot by contacting directly the application's worker. For example: https://mule-worker-system.us-e2.cloudhub.io/api/refund:8082/...
Your application should have an HTTP Listener configuration like:
<http:listener-connection host="0.0.0.0" port="8082" protocol="HTTPS">
<tls:context>
<tls:trust-store path="keystore.jks" password="123456"/>
</tls:context>
</http:listener-connection>
Note that in this configuration the port used is "8082".

Problems with DNS

Good afternoon in my timezone.
I am developing a web appp in J2EE.
This web app is called and access inside a sharepoint portal.
When i enter through the sharepoint portal i can access my application, using chrome developes tools i can see all the HTTP traffic, and i see that the browsers sends a request to the following server that is where my app is running serverprd.enterprisename.com.
But when i use the command line in my windows 7 , to ping the machine(server) , for example :
ping serverprd.enterprisename.com it returns me the following message:
"Ping request could not find host serverprd.enterprisename.com"
I am using a proxy.
Can anyone tells me why this happening ? Why through the browser i can access the server and the ping command does not find me the server ?
With the best regards.
Thanks in advance.
Your proxy server id the one who have an access to outside world. All http requests are sent to proxy server and proxy server does DNS lookup. In case of pin, your host have to do DNS lookup and this operation obviously now allowed ( firewall or so).

SoapUI and web service testing with windows authentication

Blockquote
I'm trying to test an already deployed web service through SoapUI. The service URL is https://hostname:82/Service.asmx. I modified the test Endpoint to reflect this. Web requests go through a proxy that uses Windows Authentication.
First I attempted to run the test directly but without success. All I got was an error:
401 - Unauthorized: Access is denied due to invalid credentials
Next, I entered proxy details and domain username/password into SoapUI proxy settings. This creates another error:
status# HTTP/1.1 502 Proxy Error ( The specified Secure Sockets Layer (SSL) port is not allowed. Forefront TMG is not configured to allow
SSL requests from this port. Most Web browsers use port 443 for SSL requests. )
I wasn't really paying attention to this until now so I ignored the error and went on to install Burp Suite hoping that this would help with Windows Authentication. I got the Internet working through Burp Suite but soapUI still doesn't do anything and I can't run any tests. This time the error is a bit different:
XML Parsing Error: syntax error Location:
https://hostname:82/Service.asmx Line Number 1, Column 1:Burp proxy
error: failed to connect to IP.
What am I doing wrong? :)
Figured it out in the end. I configured Burp proxy the wrong way. Instead of redirecting to my WS server, I was redirecting to our internet proxy which of course didn't know what to do.

Invalid URI for Localhost

We have a website/webservice running on one of our servers. We hit that webservice once a day with a scheduled .bat scipt.
Just recently the scheduled task started to fail. The log shows "Invalid URI: The hostname could not be parsed."
When we're logged into the server we can reach the website through http://localhost/website, but get an Invalid URI error when we hit the webservice http://localhost/website/ws.asmx.
Any ideas?
Edit:
We'be tried using the servername, the ipaddress, and port numbers (and combinations therein). Any other ideas?
For the private IP Address your using Wikipedia Reference http://en.wikipedia.org/wiki/IP_address for what are the limits and proper uses.
If you have access to the source code for the web service look for fixed IP Address being used along with having correct Server Bindings for using the service.
Try using the IP Address of the machine instead of localhost.
Basically, I'm taking a wild stab that someone ran a lockdown or a service patch was installed that somehow is filtering request resposes to localhost (127.0.0.1).
Try using the machine name instead of localhost

Resources