SignalR - get prompted for username and password on connect - signalr

I've got a self-hosted SignalR server which has IntegratedWindowsAuthentication turned on.
During the negotiate phase of the connection (from Chrome) the browser throws up a username/password prompt. If I click Sign In without filling in any details then it connects me to the hub as ANONYMOUS LOGON.
How can I configure things so that my Windows identity is seamlessly passed through so the hub knows who am I and that the browser doesn't prompt me?
This is a non-Core implementation of the SignalR server.
Thanks!

On your Main method try this:
connection.Credentials = CredentialCache.DefaultCredentials;
Read more about this here.

Related

ASP.NET Windows Authentication using server-local accounts?

I'm trying to set up an ASP.NET application to use Windows Authentication.
But the IIS server is not part of a domain, it is a sole server hosted in our Rackspace account.
I'd like to have the Windows Authentication module validate against the list of local Windows users on the IIS server. Is this possible?
Anonymous Authentication is off
Basic Authentication is off
Windows Authentication is on
But when I enter credentials for a local machine account as
machinename\user
password
it doesn't seem to work. It just prompts me again.
Is possible make a local machine validation, like this:
var bool valid = false;
using (var context = new PrincipalContext(ContextType.Machine))
{
valid = context.ValidateCredentials(username, password);
}
It appears that you can use local accounts, but I'm getting some kind of server error when the account tries to authenticate.
Once I found the error in the event logs, and got the status code, I was able to track it down, and find this answer, which worked exactly!

When connecting to snowflake by ODBC and SnowSQL with SSO (SAML), can I connect with IDP initiated?

I want to access snowflake with SAML from ODBC.
I can connect with internal snowflake authentication(user & password) from ODBC.
At that time, the parameter of authenticator=externalbrowzer.
Nothing happens when the browser starts and I authenticate with SAML IDP.
Does authenticator=externalbrowser not work if SSO is IDP Initiated?
idp uses a custom idp.
[snowsql example]
C:\Users\testuser>snowsql -a xxx99999 --authenticator externalbrowser -u xxxxxxx#sample.com
Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
Similar to ODBC, nothing happens when the browser starts and I authenticate on the IDP screen.
We use SAML auth and have used authenticator=externalbrowser (i assume the "z" is not a typo) as option to initiate SAML authentication. Have you tried SAML auth to connect via the UI?
externalbrowser is an SP initiated request and definitely requires SP initiated. If you can go to the browser and login without entering an IDP initiated URL, then it sounds like SP initiated might work. Do you get a login button that says "login using SSO" or something like that with Snowflake? The client has to initiate SSO and the browser has to redirect back to "http://localhost:". Does the browser show the snowflake console or does it say something like "You're authenticated, you can close this browser"?

How do I send SMTP mail from a Azure website?

I'm using the smtpclient class to send email from my asp.net website hosted on Azure in the 'shared' setup. Everywhere it says that port 25, and ALL ports are open on the Azure servers. My code works from my onw pc, but when published on Azure, it breaks. I am using gmail port 587 secure smpt and I get the error System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
Any ways to get around this? (Without installing a vm with Exchange on it, like ocme on, it's a simple email message).
You are getting that error because of these two possible reasons:
You are using the SMTPClient of Gmail and you are passing the EmailId of some other website like Yahoo/Hotmail etc.
EmailId you are using is not authenticated, you need to provide your mobile number to authenticate your Email Id.
If you are using Yahoo/Hotmail then you can refer to this article which I had created on http://www.c-sharpcorner.com/
http://www.c-sharpcorner.com/UploadFile/cd7c2e/send-bulk-email-from-yahoo-and-hotmail-using-Asp-Net/

I don't have access to webservice, what to do?

The request failed with HTTP status 401: Unauthorized.
When I test in the browser it works, but when I call it from another application I don't have access. What to do? The application where the webservice is using windows authentication. It's propably there the problem is, I suppose!
I solved it:
They are on the same domain but not on the same application. I pass
the authentication with the webservice call:
cm.Credentials = System.Net.CredentialCache.DefaultCredentials;
Windows Authentication for a web service provides some challenges; the web service would need to be on the same domain for that to work I believe, so that it could use the user's credentials.
Do you have to use windows credentials? Using a ticketing system, which requires the user to first login through another web service method, can work just as well.

Authenticating a Web Service

We are deploying our ASP.NET 3.5 app to a production server for beta testing.
Each page is secured using SSL.
On our homepage (default.aspx) we have web services which populate flash objects.
I am getting an error:
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
Also, when using firefox, receive the Windows Login pop up screen.
Does anyone have any clue what or why this is happening?
Much thanks!
I would think that the request from Flash to the secure web services doesn't have credentials or that the secure certificate in the response can't be validated.
Probably both.
So in flash there will probably need to be some code like:
request.Username = "xyz"
request.Password = "***"
or something similar
In .net there is a way to manually override the validation of a certificate for the request. I'm not sure how you would do that in Flash.
I'll update this if I find a sample for the .net way.
Sounds like IIS isn't configured for anonymous access.
If you believe you have it setup correctly (sounds like it isn't), then you might try troubleshooting your connection with Wfetch.

Resources