How can I authorize a user without using the browser? - c#

My app is Windows based, and there is IE installed. But my app will run in a process which does not like externally-launched applications (like a web browser, when authorizing). Instead, my app will use the host application's web features to display a browser.
The host app takes over the front-end and is a public kiosk-type application, so I have no control over how browsing gets launched. The google drive api automatically launches the default browser (with an affinity toward Chrome, even if not the default... :-/

I cant give code examples, but you need to look into non browser based auth - i.e. server side authentication https://developers.google.com/drive/web/auth/web-server?hl=en

Related

How can I request the user to open Desktop Application in React?

I couldn't find the exact answer I was looking for. I have two applications - web application built with react and desktop application built in C# Forms. What I want is if the user goes to a certain page in the Web Application, the browser should open (with or without a request) the windows application and send data, like the user's id. Could you guys give me an advice how this can be done?
For that, when installing your windows C# form in the user machine, you need to register a custom protocol in the registery.
See How do I register a custom URL protocol in Windows?

How to Indicate Name of Application in HTTP Request using Embedded Browser

Our application uses the Chromium Embedded Framework. We need a way to communicate to our servers within our requests that they are communicating with a Chrome browser embedded in our application. Changing the user agent isn't really an option because some sites do not play well with browsers which are not recognized. I suppose we could get around this by appending the application name to the end of the default Chromium user agent header. Our server could then check to see if the user agent header contains the name of our application. I'm unsure though if some sites will still have an issue recognizing our application with this method. I'm also unsure if there is better way to indicate this, maybe through the use of cookie or setting a custom field on the request header?

How can I call a win app on client machine from my aspx web page?

I want to call a windows application on my clients machine from my aspx page , and If It's possible I want to send some parameter to the application . Any guids ?
The only way you can do that is to custom-develop an ActiveX control and host that control in your page. Then the user would have to allow ActiveX controls in his browser. Normally, a browser is a sandbox, so you cannot access Windows from it... But with ActiveX, this is possible.
Here is a tutorial for developing ActiveX controls in C#: http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/
Of course you can still use the old way, that is VB6 or C++...
You may use Shell API in javascript to invoke your windows application. This works only in Internet explorer browser. You need to make sure that your browser security settings (At client) is also changed to "run activex controls"
Here is a sample.
I don't know the specific details, but this might point you in the right direction.
For instance, some IRC applications react when you click a link whose target is irc://some.host.com
Same goes for textmate application for mac:
txmt://open?«arguments»
This, however, is only possible if the target application has registered a custom URL schema in the user's machine. Furthermore, the User has to allow access to it.
You could write a ClickOnce application that you can launch from the web page.
If you make it a full-trust application, you can use it to launch the local Windows application. You can pass arguments to the ClickOnce application, which can parse them and pass them on to the local Windows application.
Alternatively, if you are the author of the local Windows application (and if it is C#/.Net) then you could make the Windows application itself a ClickOnce application.

Sharing web application session with a web service

Environment:
We are having a Website and a separate ASMX - Web Service sharing the same database (MS SQL 2008). Web Service is serving the Mobile Apps at the moment. Projects are done using c#, Asp.Net, 3.5 framework, VS 2008.
Requirement:
We need to avoid same user login into Website and Mobile App (Using the Web Service) at the same time. Basically user can log in only to a one service at a time (either web or app). Also, user should be able to log in to Mobile App as soon as web browser is closed or logged out.
If user tries to log in while already logged into the other service, code should have a way to find it for notification and restriction purposes.
I think AppFabrc address the requirement but needs Windows Server 2008 R2 which we don't have at the moment.
Hope you have better ideas??
Please note this is not the same question as this.
FYI... you don't get any notification when the browser closes. You could go based on the last activity time (basically keep track of user activity - page clicks, etc). I also don't see how appFabric is going to help. You still have the same problem.
As others have mentioned, there is no easy way to know when somebody has closed the browser. You could use javascript to detect when somebody leaves your web app but there are some issues (see the following question and answers for more information: How to capture the browser window close event?)
If you're open to other workflows, you could try this:
When the user logins to the mobile app, have the mobile app log him out from the web site.
When the user logins to the web site, have the web site log him out from the mobile app.
That way your users would login and start working right away instead of them having to log in, see an error, logout from the other app, log in again.

Single sign on across different web browsers

I'm trying to create a web app (website 1) housed inside a windows web browser control. Links in this web app will redirect to another website (website 2) and open in the user's default browser. So the problem I have the windows app housing website 1 is unable to communicate with website 2. Website 1 and website 2 can potentially share the same database.
Is it possible to implement a type of single sign on that I can some how persist across different browsers?
I'd go with using cross browser cookies. (e.g. Flash cookies are cross browser)
http://www.nuff-respec.com/technology/cross-browser-cookies-with-flash
http://www.sajithmr.me/cross-browser-cookies/
http://www.ts0.com/2007/12/cross-browser-cookies.asp
http://www.jon-reed.co.uk/2010/06/28/track-web-visitors-using-cross-browser-cookies-that-won%E2%80%99t-be-deleted/

Categories