Using Active Directory services with a Silverlight Browser Application - asp.net

I'm making a Web App with Silverlight for my company.
This app's aim is simple : let each user to manage his informations on the AD such as adress, city, phone, mail...
Because I'm friendly with WPF Desktop App, I want to do that with the same XAML and C#, so I choose to use Silverlight Browser App.
I've seen that I can't import System.DirectoryServices so I can't use common DirectoryEntry.
Please, can someone tell me exactly what to use and how to use AD with Silverlight app?

Silverlight only has access to a small subset of the classes available in the full .NET Framework. Furthermore, the Silverlight application runs in a secure sandbox in the browser.
To do what you want, you must expose the data through a web service.
The easiest place for you to start is to look at RIA Services.

Related

Allow some controllers to one app and not the others

We are developing a mobile app and this app will call the same APIs as the web one.
We want to create specific controllers for the mobile app and prevent it from calling the ones for the web app and vice versa.
Both apps send an access token which contains the client_id for each app.
Is it possible to do something like this :
[Authorize("mobileOnly")]
And check in the OnAuthorization if the request comes from the mobile or web app.
Or is there a better solution?
Edit: We are using .Net framework not .Net Core

building a web proxy to a desktop application using .net

We have a regular .Net4 desktop application built using WPF that exposes a handful of methods via WCF as Net.tcp and also WSHTTP as a rest interface for some simple remote control and remote querying. This is so we can provide some easy 'dashboards' that keep track of what each of the applications is doing around an organisation. We have used MVVM patterns wherever possible with future expansion in mind.
We now need to build a web application for users to do some remote work. Most of this work will be done by the web interface itself directly accessing the SQL database and other resources and rendering HTML back to the end user.
We also want the users of this web application to be able view these dashboards for certain specified desktops, at which point we need to then have the Web application query the desktop applications for the answers.
In due course it's likely that we will expand this further to expose REST or SignalR based or similar to support a Xamarin based set of apps.
My current theory is that we will build this web application using ASP.Net and host on IIS and whenever the user needs to access a resource that requires connecting to the desktops we spin up a WCF connection to the REST services running on it, send the query, process the result and return it onwards to the user.
Is this the best way to go about it, or is there some sort of native web service "proxy" that we can utilise to transparently forward the request from the website user onto the desktop?
Any and all advice would be greatly appreciated!

What is the best architecture for building a .NET website that may also support a native mobile app in the future?

I am in the planning phases of building a new ASP.NET website. The website is really a transactional web application where the users will log in and perform basic CRUD data operations. For right now this website will be accessible through a traditional desktop browser and a mobile browser. For the mobile browser we will build a separate scaled down version of the site.
In the future we may decide to create native mobile applications for Android or iOS devices also.
So the question I have is what is the best way to design the system to easily support that? Here is what I am thinking. I am thinking of building out 3 tiers to the site. The back end will be the database - SQL Server 2008. We will use stored procedures for all data access. The middle tier will be a web services tier. This tier will be built using RESTful web services and will contain all of the business logic. These web services will provide access to the database. The front end will be built using ASP.NET. The front end will only contain presentation logic. These tiers will actually be deployed on physically separate servers.
Then I am thinking that when we decide to build a native Android or iOS app that we could build those apps to simply call the same RESTful web services that the main site is calling.
Does this seem like a reasonable approach? The only thing I can think of is that the way we are building it right now the web services would be behind the firewall and would not be accessible to the outside world. When we want to support a native mobile app then we would need to make the web services accessible to the outside world.
Any thoughts? Does this seem like a good approach for building a high availability, high usage web app that needs to support native mobile apps in the future?
Thanks,
Corey
I'm with Rober Harvey there. With ASP.NET MVC you can make the presentation site in no time, use as Models your web service; with the link that he gave you, set the site for mobile browsing, and use the web services for the mobile apps when you build them.
For me it looks like a good plan. Regarding the web services being public, you can protect yourself by implementing API keys in the web service, so only your apps can use it.

Silverlight and RIA Service without ASP.NET

I'm pretty new to Silverlight/RIA/Asp.Net thing, and I'm trying to figure if an Asp.Net website is required (for hosting the app) if I wish to use RIA services with Silverlight?
You could use a Web Application for hosing the RIA services in which is a compiled version of a Web Site. This is a distinction made by Visual Studio for different types of web projects but that might not be what you mean.
Really though RIA is just web service that takes a certain set of parameters. You technically could use PHP and generate the same content although that seems like it might be a bit of work unless there are frameworks that already do this.
Your RIA service will need to live somewhere online though. You don't need a website with web pages but you will need to run the service in a web server like IIS and that means it probably needs to live in a web site, even if the website doesn't have any web pages.
No, you can not use RIA services without an ASP.NET application. While it is true that you can create the backend data service with PHP (or a number of other web technologies), that would not be making use of RIA services.
The basic idea of RIA services is to provide a super simply means of plumbing your data classes through ASP.NET. Mostly it is used in conjunction with an ORM and additional metadata classes in your web application. You then provide a service to manipulate your data. When you compile the solution than the work you did in the web project gets pushed into your Silverlight application (through code generation).

Can I host an ASP.NET application in a CAB WinForms application?

I have a .NET 2.0 WinForms application that was developed using the Composite Application Block and Smart Client Software Factory.
I'm considering the development of a module that would contain a browser control that would access the ASP.NET website using credentials established when the user logged into the WinForms client.
My goal is to use this strategy to transition all of the modules that are currently in the client to ASP.NET and retire the 'smart' client. Security for the WinForms client is currently implemented using the ASP.NET Membership functionality.
Is this possible? Sensible?
Yes, you can. Make a SmartPart that hosts the WebBrowser control, add some buttons for forward and backward navigation, and a url textbox; then point the WebBrowser control at your web application's URL.
It is sensible. We used CAB/SCSF to create an application we called "The Integrated Desktop". This application serves as the platform for all internal apps for the company; everything is integrated into this one desktop application. We added a foundational module, basically a beefy version of what I described in the above paragraph, to facilitate web browsing since a few pre-existing apps were web-based and our users wanted access to those at the same place they were doing all their other work. One cool thing was the use of the WebBrowser's ObjectForScripting property that allowed for somewhat seamless integration between the desktop app and the web app being hosted inside.
What are your requirements?
You would choose a web app over a smart client mainly
if you have to reach people that
are not on the Windows platform or
you have a need for a
zero-install app
By having your app users having to access the web app via the smart client (browser-control) you would be missing (1) and (2). In my opinion it would defeat its purpose.

Resources