Blazor not providing individual sessions. How to fix? - signalr

I have a Blazor Server app hosted on an Azure App Service, which communicates to an on-premises server connected through a VNET on Azure.
I have custom authentication in place where a user will use their login credentials which is validated in the on-premises server which returns a token.
Now my issue is that it seems like there aren't individual instances of the app.
I've come to this conclusion because of the following scenario I've encountered:
I have a ZXing barcode scanner which displays a decoded barcode in the following manner:
<input type='text' value='#Barcode' disabled="disabled" />
The value is displayed in the textbox once a barcode is found.
Here is my issue:
Open the app using live URL on my mobile phone and on my PC
I scan the code on my phone
The PC's textbox is updated with the code I just scanned on my phone?
Is there a specific configuration I'm missing or am I misunderstanding how Blazor works?

The cause was the BlazorBarcodeScanner.ZXing.JS, Blazor barcode scanner .
I manually implemented the JS library and my problem disappeared.

Related

Deploy and hosting blazor wsam with individual accounts

I create Blazor web assembly Withe individual accounts Option(SQL server).
It works fine on my computer. Register new user and login is fine.
But After Publish and Hosting error 500 appear and app not load.
What should I change during publish? I change connection string to server address and set database user name and password and then Update-DataBase.
But app cannot connect to DB and send error.
Thank you
I tried many ways, but unfortunately I did not get the result.

AcquireTokenAsync asp.net failing modal dial box or form

C# ASP.NET web page that has requirement to MFA to Azure SQL Database.
I have working in development environment.
When I deploy to web server error is received of...
"Showing a modal dial box or form when the application is not running."
I understand why it doesn't work, but how do I get a redirect to work against Azure SQL Database to get a token for the SQL Connection ?
Best answer was:
Acquire AAD token using ASP.Net web forms
What am I missing to make MFA to Azure SQL work in asp.net?
result = await authContext.AcquireTokenAsync(
parameters.Resource, // "https://database.windows.net/"
_clientId,
_redirectUri,
new AD.PlatformParameters(AD.PromptBehavior.Auto),
new AD.UserIdentifier(
parameters.UserId,
AD.UserIdentifierType.RequiredDisplayableId));
Follow up, I have the basics of this worked out.
Enable HTTPS (this was an on-prem, internal use web app, was not https, it is now).
Ensure .net 4.7.2
Ensure URI()'s match azure application registration (was missing this)
The redirect and URI back are causing me to change the design and flow of the web page, but that's a side effect of the MFA requirement.
Will post some follow up code example once i have it working the way it should, but a quick test has it working, much easier in windows application as opposed to a web app.

Can Azure Web App receive email SMTP, and send email (SendGrid)?

Presently I use VisualBasic .NET web app (with SendGrid for email) running on my Azure server VM. I receives SMTP email from public Internet directly to the VM ok. It send email using SendGrid addon ok.
Will this all work if I switch to Azure Web App (formerly Web Site)?
Should my web app code work as-is without modification, even the SendGrid calls?
Outgoing email using SendGrid will not be a problem at all. Using it on App Service is common and you probably don't need to change any code at all.
Inbound may require changes depending on what you're doing. Are you simply polling a mailbox somewhere else and then doing something with the messages? If so, you could convert that to a scheduled WebJob poll at a specific interval and act on incoming messages.
If you're running an SMTP server on your VM to receive mail, then that's something you cannot easily replicate on App Service.

Suprema BioMini slim fingerprint web application

I bought a Suprema BioMini Fingerprint device. It has a SDK, but the documentation is not that good.
What I am trying to do is to create a web application using asp.net that interact with this fingerprint device, The SDK has a working web application that interact with the device.
I've used the Javascripts functions that comes with the sdk as the documentation says, but the following problem shows when I try to capture a fingerprint
(No session cookie is passed)
Have any one face that problem and managed to solve it?
Thanks
How about you enable cookies on your browser and if that does not work you attempt to use another browser to see how it responds?
The other thing could be you are just running the HTML without hosting it on a webserver. If that is the case, check that you are using an appropriate webserver like IIS and confirm if it is running on your test / developer platform.
salam mohammed
when you first log in to the server (from inside your code)
you will recieve a session id with the response.
store this session id, and every time you comunicate with the server, you must send this session id with the request stored in cookie, if you do not send the session id you will recieve this error: (No session cookie is passed).
Please see this link:
http://kb.supremainc.com/knowledge/doku.php?id=en:biostar_2_api_quickstart_guide
That's because you didn't set cookie in your java script codes (refer to page 251 in documentation).

How to access client side scanner from server and upload scanned image to server?

I have to create a web application in asp.net, that will be hosted on server and access client side scanner. The end users scan the images and scanned image is then uploaded to server. My web application is running successfully in single system. But when i hosted it in IIS and tried to access it from a client machine with a scanner attached to it, the application is not working.It is not able to access client side scanner.I am using WIA concept for scanning.
Can any one suggest a way to access client side scanner from server?
Directly its not possible, as its a security breach.
You can use piad third party library
like http://www.dynamsoft.com/blog/document-imaging/web-twain-webcam/how-to-scan-documents-from-an-asp-net-web-application/
http://twainx.sourceforge.net/
http://www.dosadi.com/eztwain3.htm
Or
Flash
Or Silverlight
I would preffer a user a control created in Silverlight for scanning purpose. This is your WIA concept. a gud place to start.
http://10rem.net/blog/2010/04/14/scanning-an-image-from-silverlight-4-using-wia-automation
This can also be achieved by using WCF, refer
http://www.codeproject.com/Articles/493333/Client-Side-Printing-Scanning-in-NET
Another way is write an Active-x control, but this solution will be limited to IEs.

Resources