I want to build a real-time application where user gets notified for each update on the server. User is logged in on site and would be notified in real time(one to one).
What is the best way to achieve this?
I am using ASP.NET MVC 4 for server side and I need a better and reliable option to achieve this.
The best way to achieve this depends on your exact requirements. Without knowing that, an option to do it would be by using SignalR.
Part of the SignalR resource page also contains a demo for using SignalR with MVC 5. Other resources for SignalR are available online.
Related
I wanted to know how can I implement the SSO authentication between multiple applications using the SAML in ASP.NET Core?
Is this a safe and secure way to do it?
If you know the information, better free method or how to implement it, write it down.
Thanks in advance.
I don't think free method exists. Unless you want to implement solution from scratch by yourself, which seems to be a lot of work to do.
So, if it's an option you could use some commercial solutions. I have experience working with ComponentSpace.Saml2. Configuration is pretty straightforward - you need to fill and store a bunch of configuration items such as identity providers' params, certificates data, login and logout endpoints. Then controller needs to be built, containing methods for initiating saml request and processing response from identity provider. That's just infratructure level - of course you'll need to implement authentication service to manage SAML response and to decide how it integrates into your app's architecture.
Well, as you can see, the answer is general, so is the question.
Hope this helps. At least to choose right path to go.
I have an Asp.Net Core Web application and I need to mark the deadlines as "passed" or something like that in the last day set. The administrator can add a deadline and the other users must send their options until the last day set by the admin. How can I update the deadline automatically, on the server? I was thinking to use Ajax(when a document is loaded, the client will make a call and the deadline will be set if it is expired), but I want to know if there is a solution that is just on the server, without help from the client. I don't want to use the ajax solution because I don't want to have too many redundant calls to the server. Thank you!
Since .NET Core 2.0, the framework provides a new interface named IHostedService helping you to easily implement hosted services. By using it, you could run a background service or build a scheduled task in the background. More detail information, please check the following articles:
Background tasks with hosted services in ASP.NET Core
Building a scheduled task in ASP.NET Core/Standard 2.0
I Have ASP.NET Core project and want to make it work also with PWA and it needs to work also offline.
I know there are prefetch and preload options but i'm little bit confused
How to achieve that?
Thanks
First, the PWA and the service worker itself are decouple from the server, which in your case is ASP.NET.
As far as what you cache and how that is all up to you. You need to determine what is best for your user experience.
In a way, the service worker can be thought of as a web server and you have to code the application layer to manage your requests.
DO NOT go nuts and try to recreate your ASP.NET and all the server logic in the service worker. Not what you should do there. Seen that too many times already.
I have an article covering basic service worker caching concepts if that helps.
https://love2dev.com/blog/service-worker-cache/
I am building a service-oriented system for personal use (plus few friends may have limited access as well) - the aim is to have a dashboard for controlling my apps running on various machines such as Raspberry Pis (and potentially to be expanded to a VPS or few in future).
The architecture itself is pretty simple. For authentication I want to use AWS Cognito. Services would communicate with WebAPI (and potentially with eachother) using gRPC within a VPN, and dashboard would be served by Blazor server-side (may move to Blazor WASM Hosted model if I find a need for it). Each of the processes may or may not be on the same machine as any other (depending on the purpose). Blazor server may or may not run within VPN (I might want to move it to a separate web hosting later).
I created a simple diagram to visualize it:
The problem comes with authentication. I want to have Blazor server-side and API as a separate processes (for now they're going to run on the same machine, but I may want to move it elsewhere eventually). Ideally authentication should be handled by API, so authentication is client-agnostic, and the API can use it to verify if the logged in user can perform an action - which by itself is simple.
However, I want Blazor server to use and validate that token as well in order to determine what to display to the user. I want to do with the least amount of calls possible - ideally avoiding querying API for every 'should I display it or not?' choice.
I could easily do it by sacrificing possibility to move API elsewhere, and just merge Blazor Server and API Gateway into one project. For my current purpose it would be enough, but it's not an ideal solution, so first I want to look into how could I achieve my original vision.
How could I achieve this (with minimal amount of Blazor server to API queries)?
I was googling for solution a lot, but so far only found either examples of using Blazor server and API as one project, or using client-side calls to API directly.
Thank you good folks in advance.
I am developing a application that is using backbone.js for most of the front end logic and was thinking of using sqlite for storage, but i have run into a few complications with it and need to switch to another NoSQL database.
I see on ravendb's site that it was created in C# and you need a .net compiler. Most of the docs are for ASP MVC type application. I can not go this root because we are developing this as a tablet application with no microsoft based technologies on the client side ( because we want it to work with android and apple )
The server however will be .NET and so i figured this might be do able. Just wondering if this is worth pursuing and if anyone has had any experience using ravendb? Or should i go for mongodb?
It is possible to expose RavenDB directly to a JavaScript application, sure. But it's usually not recommended. The main reason is security, but there are many other reasons to have a middle-layer.
For example, you often need a server-side location to perform application logic. Not everything can be done in the database itself, and if you do it all in the application then you will probably send a lot more data to the app than it really needs. Over the internet, that could mean a slow app.
The route many people take, is to use ASP.Net WebAPI, or ServiceStack, or another similar framework. This gives you a way to expose REST endpoints that your JavaScript app can call. You can connect to RavenDB from there.
Also, you seem to have the misconception that if you used ASP.Net MVC on the server that you couldn't target Apple or Android. That's just false. Whether you use a SPA approach or a traditional approach, you are delivering standards-based content, such as HTML, CSS, JSON and JavaScript.
Yes, You can use it. Actually RavenDB's server is a RESTful web service, which means you can work with it with any kinds of HTTP clients. These clients should be able to issue standard HTTP verbs like GET, PUT, DELETE etc.
ASP MVC is server side. I still at a loss as to why you would want to expose your db to a clientside piece. It is completely worth doing in a server side piece, but do not expose something like a db directly to your client.