Problem with use WebSocket transport on SignalR ASP.NET WebForms app with Azure SignalR with custom domain - asp.net

I have a problem with use custom domain on SignalR Azure Service with my ASP.NET WebForms app containing SignalR hub.
I configured custom domain at SignalR Azure Service as in the picture
Azure SingalR Service custom domain configuration
When i use connection string like this:
"Endpoint=https://example_endpoint;AccessKey=example_accesskey;Version=1.0;"
everything works perfectly and I get WebSocket transport.
But when i trying to use custom domain in connecton string like this:
"Endpoint=https://example_endpoint;AccessKey=example_accesskey;ClientEndpoint=custom_domaint_endpoint;Version=1.0;"
I get "HTTP Authentication failed; no valid credentials available" error and my transport is switching go SSE.
Console SignalR client logs
What should I do on server or client side to have SignalR communication with custom domain and WebSockets transport?

Related

SignalR sticky sessions with F5 and Citrix

we have a web application (angular) that needs to interact with a winform application. we do that via SignalR.
the browser and winform are deployed on a citrix server.
There is a webfarm of IIS servers and on those we have the webapi services and also the signalR Hubs.
all network activity goes via F5 loadbalancer.
the problem we are facing - is how to make sure the web applicaion running on chrome, and the windows forms application connect both to the same SignalR Hub Server.
we cannot use stickey sessions based on Origin IP as all users are using the citrix infrastructure, so all have the same origin IP.
using a cookie - i am not sure that the cookie is shared between the browser and the winform app. and anyways cookie in a websocket scenario isnt working (right ?)
is the only solution using a backplane ? (not using dotnet core at the moment)
Override or Change source Signalr
Private Task ProcessNegotiationRequest-->
string connectionId = !string.IsNullOrEmpty(context.Request.QueryString["ConnId"]) ? context.Request.QueryString["ConnId"]: connectionId = Guid.NewGuid().ToString("d");
And send conId in querystring

how can Azure Web App receive email SMTP?

My .NET web app presently uses Azure Windows server VM to receive and send SNMP email. My users send email to my web app, and my Windows server VM receives this email into its SNMP and then deposits it into a folder, which gets read by my backend .NET app.
I'm interested in switching to the new Azure web app model, but can't find anywhere how it would receive email.
My DNS provider uses my MX RECORD configuration to forward email from my users to the IP of my present VM server and then to its SNMP receive service, etc.
To receive email with a Web App in Azure App Service, you can setup a Web Job that can poll for new emails on a Schedule or Manual trigger, then perform a custom action necessary.
Another alternative is that you could create an Azure Logic App that is wired up to be notified of email messages. This can be done using the Outlook connectors (if you're using an Outlook email) or other connectors. Then the Logic App can be setup to make an API call to your app to trigger some sort of custom action to take place for emails received.
The configuration you have today on a full VM can not be implemented in Azure App Service Web Apps. The underlying managed VM that hosts the Web App isn't accessible and configurable in this way.

Asp.Net Web Form calling same domain WCF service without need for authentication

I have a aspnetcompatibility=true WCF service (http binding) in the same domain of my Asp.Net website.
I want to make a call from my Asp.Net server side code to the WCF service.
I have tried to make a web request to http://testDomain/mySite/services/mySvc.svc but got the login page instead.
Is there a way to call the wcf service from the same domain asp.net site so that the service knows to not authenticate again?
Note: I use IIS7, and I'm open to change by binding as long as I can make a call to it w/o authentication. I'm hoping to host the svc in IIS.
Try to enable windows authentication in IIS for your hosted service and disable anonymous authentication (if it is enabled). Besides, pass security credentials (domain credentials perhaps in your case) from the client to the service.

WCF Direct Authentication using BasicHttpBinding

I am trying to test a simple scenario in my development machine wherein I have a service which is configured on basicHttpbinding. I am trying to use CustomUserNamePasswordValidator and have configured Security level as "TransportWithMessageCredential"
Now, when I test the service with a web client (both service and client on Asp.net development server), service completely ignores the validator and simply returns the data, although I am passing wrong credentials from my client.
Is it because I am using VS Development Server ?
Is use of SSL over HTTP manadatory when we use TransportWithMessageCredentials. Is there an alternative wherein I need not use Https ?
WCF does not support any configurations out of the box which would permit transmission of unsecured credentials.

Calling web services from ASP.NET application and connection management

I have an ASP.NET application that calls other web services through SSL (outside the application). I simply added a web reference (https://url/some.asmx) and used the web services and it works well. However, my questions are, how is the connection (channel) managed? is the connection to web services dropped after each web services call? or do they use the same connection (channel) for the subsequent calls? if they do, how long is the trusted connection kept alive?
Classic ASMX web services maintain the connection for a single request - that's why the methods you call via the web service class must be static. A SOAP call is very similar to a plain vanilla HTTP Request:
Open connection to URL
Pass in request - get/post, etc
Server renders an XML (SOAP) response
Connection is closed
Client processes response.
The web service framework wraps most of this so that you can conveniently access the web service as if it were a local object, but there is no server-side object instance persistence any more than there is for an ASPX page.
WCF services, on the other hand, maintain the connection until the proxy object is closed. This gives you a LOT of power, but, of course, with great power comes great responsibility.
update: link regarding ssl caching:
http://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/f86066e0-a24b-4d5e-873c-ed427d1faef7/

Resources