Not able to get any response or error while using Spring Websocket STOMP - spring-websocket

I am using code given in this link : https://spring.io/guides/gs/messaging-stomp-websocket/
When I start my application as spring boot, it starts properly and also the web page is opening on port 8080 but when I click on connect or Send My name to connect then nothing is happening, getting no response anywhere and none error. Please can anyone help me with this

You error dispalyed in browser console, you need to check it. In my opinion this problem connected with CORS. Try this:
#Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/gs-guide-websocket").setAllowedOrigins("*").withSockJS();
}

Related

Auth0 checkSession call to renew return an HTML error page

I have a Single Page App using Auth0 Implicit Flow with Silent Authentication. I got the authentication part working just fine, but when I try to implement checkSession method to renew the session in the background (as per https://auth0.com/docs/libraries/auth0js/v9#using-checksession-to-acquire-new-tokens), the AJAX call to the auth0.com domain returns a 400 HTML error instead of a JSON one.
webAuth.checkSession({}, function (err, authResult) {
...
});
The error is Oops!, something went wrong, which I can see in my browser devtools Network Response tab.
There could be a misconfiguration in the system or a service outage. We track these errors automatically, but if the problem persists feel free to contact us.
Please try again.
I am not sure why there would be an HTML response, and not sure what I might be doing wrong. I have added my page's domain to the "Allowed Web Origins" list on the Auth0 application settings.
What I was missing was providing the redirectUri parameter to the checkSession call.
I also found out that I could find logs to these errors by going to the "Logs" menu on the Auth0 dashboard.

timeout in telegram.bot webhook - asp.net mvc

I had been developed a telegram bot using Telegram.Bot.
I tried to rework with the bot, First I created bot using BotFather and got token.
I set webhook server api address in telegram api. But when I check webhookinfo it returns this error
https://api.telegram.org/botToken/getWebhookinfo
respone:
"last_error_date":1585419712,"last_error_message":"Connection timed out"
I checked it need TLS12 to have secure connection using
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
But It's not getting updates in my server and show time out error.
I tried posting using postman and ngrok to run on my iisexpress and I'm getting data and can sending messages to bot in my localhost.
But In hosting it's not working, whats wrong with new Telegram.Bot library or telegram server?
update
I checked with postman my hosting url, post man also cant connect to that url. what can be wrong with my codes?
This is response when i'm call update receiving URL in my hosting:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.10.34.35:443
I got problem, the certificate which we use should be valid one, not free.
For more information please study this link:
https://core.telegram.org/bots/webhooks

Error 403 - Forbidden error when I'm trying to access ?WSDLs from browser in WSO2

Dears, I'm trying to access this URL through my browser: https://localhost:9443/services/OAuth2TokenValidationService?wsdl
But I'm getting error 403
I followed everything based on this doc,
please someone help me.
If you set <HideAdminServiceWSDLs>false</HideAdminServiceWSDLs> and restart the server this should work.
First understand what the 403 error means.
The error (HTTP 403 Forbidden) means that the browser was able to connect to the website, but it does not have permission to view the webpage.
So, check the user under which the process is running. If that user is not having the right permissions, then this error will pop out.
Kill the process id, and start the server with the correct user who is having the right permissions.

PhoneGap Ionic project not performing $http.post on iOS device

I am using the Ionic framework to build an html5 app that is then deployed to an iOS device with PhoneGap. Everything was working great, then we switched some server addresses that were being used to get data to include a port number in the address and the HTTP method was switched from a GET to a POST. After the switch we tested locally in the browser and it was pulling data with no problems. When we deployed to the device we saw nothing in the logs when the request was executed, and the success or error handler was never reached. In the code below only "HERE1" is printed and everything stops.
console.log("HERE1");
$http.post("http://XX.XX.XX.XX:81/api/Authenticate", null ,{ headers: {'Authorization': 'Basic ' + encodedNamePw} })
.success(function (data, status, headers, config) {
console.log("HERE2");
})
.error(function (data) {
console.log("HERE3");
});
I then tried to perform a GET to the same address and I got a response, saying that I obviously had the incorrect method. I then tried a POST to the address without a port and I got response, which was again an error, but at least I got a response. So to summarize it works locally in browser, it works on the iOS device with a GET request and a PORT, but it does not make any request when I use the POST method. I did try to escape the colon but that did not help. I'm pretty baffled by this one so any thoughts are appreciated. Thanks!
After much pain an agony I found the issue and the options available. The issue was that we were getting a 401 response and a www-authenticate http header. When this is sent by the server apparently iOS tries to pop a login dialog, which is blocked by PhoneGap. Instead of hitting the error callback method it just eats it and you never get any feedback that the request has completed.
The best solution requires you to have access to the server you are calling. If you do, and you can update the response to not send a www-authenticate header for 401 responses then you are golden and it works as expected. If you can't then you have the option to set the async option to false on the request. This approach will block at the UI, which is not ideal, but may be acceptable if it is just a login request. Best of luck.

Youtube: Error authenticating (check service name)

I've created a Gmail account and linked it with Youtube.
I can sign in using the credentials on Youtube site,
but I'm getting this error when I use the data API
Exception:
com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
Code:
YouTubeService service = new YouTubeService("", messages.get("youtube.devkey"));
try {
service.setUserCredentials("XXXXan#gmail.com", "alXXXX23");
} catch (AuthenticationException e) {
Can anyone explain why this is happening and/or what the service name is?
Moving my comment to a formal answer, since it seemed to have solved the problem:
There's a list of common reasons why ClientLogin might fail and suggested alternatives at http://apiblog.youtube.com/2011/03/clientlogin-fail.html

Resources