Im beginer With Blazor , we work on system with back office and front users system that we done with MVC 5 but we want to upgrad to blazor with .Net5 , can i used Blazor Server Side as system back office and WebAssembly as Client user app if so can i set webAssembly with deferent Identify Autherntication from server side.
What you need to understand that there are two flavors of Blazor.
Server side blazor -
Where the browser is just a thin client and the user interactions are send over SignalR.
Blazor WebAssembly -
The client application and the server is separated instances. For example you can create the client side as Blazor and the server side with php, node.js, asp.net core or what ever the requirement is. Just use the communication technology that both, server and client side can understand like REST API with json.
This is something you will need to decide what to pick mostly depending on the requirements. A good point for using server side blazor if your users are not having a larger ping than 200 ms from the server. Also the number of concurent users is a great factor. More than 5000 users at the same time can overload the server, this of course depends on the server hardware.
(Server side blazor is good for intranet projects where the net lag can be keep low.)
You can read more in the official documentation.
Related
I have a ASP.Net WebAPI service that is used by my AngularJS front end and I am making use of Owin and bearer token.
Now there is a need that we need to install an agent on the few of the client machines (developed in .Net core mostly) that is able to connect to our application and make similar calls. I can create a separate controller for this need, but want to host it in the same website.
How can I create a secure connection between this agent and the ASP.Net server hosted on Azure?
Currently I am looking at generating a Token during the agent installation based on the client MAC address and giving it with each call, but I am checking if there are any better way to address this need.
Any help in this direction is welcome.
Regards
Kiran
It seems that you’d like to enable only valid “agents” that installed on the client machines to communicate with your server, if that is the case, Azure AD provides Native Application to Web API authentication scenario (a native application that runs on a phone, tablet, or PC needs to authenticate a user to get resources from a web API that is secured by Azure AD), you could refer to it.
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.
Is it possible to write a WebSocket (SignalR) client without having to embed it in an ASP.NET application hosted on IIS (or other ASP.NET web server)?
For example if I have a Self Hosted SignalR Server with a custom Hub, is it possible (and if so, how) to call it from a "pure" Javascript web client?
In that case we don't have the <script src="~/signalr/hubs" type="text/javascript" /> part with the run-time generated "magic" scripts in the ~/signalr/hubs/ folder.
You do not need to have an asp.net application for SignalR to work. You can create a generic html page and still communicate with a SignalR server. You can even utilize silverlight, windows phone or other clients to communicate with a SignalR server, there are plenty that are currently supported and even more that are third party developed (like android, ios, node etc.).
When you say "pure" JavaScript client I'm assuming you mean no third party libraries like JQuery, in this case SignalR currently does not work without JQuery but a client that does not depend on JQuery is in the pipeline (https://github.com/SignalR/SignalR/issues/372).
You can create a Self Hosted server pull down the SignalR by using ASP.NET Owin.
Edit:
In order to use self hosted servers you will have to enable cross domain in your application. See the answer to: SignalR: Error during negotiation request: undefined
I am getting my head around n-tier applications. I understand seperation of code layers eg/UI, BL (Business Logic), DL(Data Layer).
In a ASP.Net application you would just reference the C# project that is doing the BL and the DL and all is well.
What I don't understand is how you would implement this on seperate servers? Do you have the DLL for the BL and DL in the bin folder but a setting in the web.config file which tells it where to go for communication or do you have the actual BL and DL running on a seperate server and then communication from the UI is made via a web service?
At the moment I have a standard ASP.Net webforms app that needs to seperate the security side to the web server and the main app on a application server, however I dont think thats possible.
When we spit in to physical Tiers we use WCF between the tiers. You actualy end up getting many more layers in your application, so do not use it if you do not need it.
Typical layers would by
Client Tier
UI
Business
proxy
Server Tier
Facade
Business
Data access
Server Tier can be implemented as a single Layer if you use an ORM.
This isn't directly possible without clustering, and even that requires exact copies of the application running on both servers.
If you want to run your security layer as a separate server, create it using web services, and make a web request to that service, and return the (encrypted or otherwise) response.
Hope that helps.
EDIT for continued Explanation:
In your case, I would have my security application running on a server that will authenticate, encrypt, and respond to requests made to it from a specific url or domain/sub-domain. Then my main application can live on another server and the requests to authenticate etc can be on a secondary server. However, ASP.NET authentication uses the machine-level key to create a unique salt for the authentication token. So in order to share auth tokens between multiple machines, your machine keys must be identical in the machine.config.
Separate servers would entail the usage of some form of web services. Here at work:
Server (piglet) - database, sql server 2005, firewall prevents connections to tigger
Server (eeyore) - web services - connects to piglet
Server (tigger) - asp.net server - connects to eeyore, firewall prevents connections to piglet
The business logic would be in a dll assembly used by the data access layer, the presentation layer, or both, and is deployed alongside them.
If you want the layers on physically separate servers, then you have to decide how the layers should communicate. You have lots of options for doing this: web services, Windows Communication Foundation, .Net Remoting...
Application Server - Instead of calling the security logic directly, call a security webservice on the web server.
Web Server - Hosts the security webservice. The webservice here does the actual business logic and can call the data layer.
I was thinking about integrating some instant messaging function into an existing ASP.NET web application, e.g:
the web application can display the online-status of users (are they currently logged in with their IM client)
users can send messages from the web application to the IM client of other users
users can initiate a IM chat from the web application (without having to know the other user's IM identification beforehand)
Does anyone know about some existing libraries, sample applications or other resources that might help implementing such a feature?
Thanks a lot for sharing your knowledge.
You should try Jabber. Demo client avaiable here.
There is an architectural overview, the main concept looks like this:
(source: webta.net)
And some citation from the site:
1. Goal
Create an multi-service instant messaging AJAX-based web application with internal accounting.
2. Main problem
We need to connect to IM servers from HTTP client (browser).
HTTP is a stateless protocol. This means that, theoretically, each HTTP request is being proccessed by separate http daemon proccess.
Once request proccessed (data sent to client), server fogets about client.
All IM services protocols are stateful.
When client connects to IM server, socket connection being created and connection much remain open for succesfull communication.
There's a list on the ASP.net site.
http://www.asp.net/Community/Control-gallery/browse.aspx?category=54
You might want to look at the .net implementation of jabber:
http://code.google.com/p/jabber-net/