Configure Active Directory with desktop application - c#

I am working on a desktop application that needs to configure user authentication and authorization with the AD. I am developing this application as Windows Form Application.
I faced following issues and I am looking for the right direction.
In my research, I saw that there is no session state like in web application. So once I configure the AD with desktop, How to manage the user token that provides by AD?
Once the user closes the application without log out, when the next time that user should be able to open the application without login. So what is the approach to achieve that?

Related

Need help on google SSO when navigating one app to another

I'm having an ASP.Net MVC app configured to use google authentication. I'm having another app which is also configured to use google SSO.
When navigating first app to second app when multiple user active google logins are available, I do not need the user to select the google account from choose account screen. I'm expecting do a token based authentication in the second application so that the app tp app navigation is seamless and the second app will authenticated with the correct google account.
Is there a way to do it or possible documentation or guide on how to do it.

Impersonate User in ASP.Net Core Web Api

I am planning a public Web Api in ASP.Net Core. Also there is a database connected and sign on is planned as well.
There is a connection from my application to the database open using Integrated Security=True;. Is it possible to connect to the database using a different user (from active directory). Not the one under which the application is running, but any other user from Active Diretory.
My understandin is:
The application runs as a certain user. Integrated Security=True; will open a connection as that user -> Not possible.
Impersonation of another user requires the app to have elevated rights and know the password from that user -> Not an option.
Doing it without a password means the applications right have to be elevated to the highest possible -> not an option.
So is there any way to connect to the database as a certain user from our AD? I have the feeling it's not possible.
Thank you!
Is that MSDN Article what you are looking for?
ASP.NET Core doesn't implement impersonation. Apps run with the app's
identity for all requests, using app pool or process identity. If the
app should perform an action on behalf of a user, use
WindowsIdentity.RunImpersonated in a terminal inline middleware in
Startup.Configure. Run a single action in this context and then close
the context.

Register desktop application

I am working on a desktop application that gives a desktop tray icon notification when a new pull request is created that requires your attention.
I have developed the application entirely using a public access token for my account. Now I have got to the point where other users need to be able to use the application, I am required to implement OAuth 2.0 authentication.
However, VSO's application authentication assumes my application is a web app and asks me for details that I cannot provide (and aren't even relevant).
How can I get an app id so other users can use my application?
I'm not sure if I'm misunderstanding the whole concept. This is the link I am using: https://www.visualstudio.com/en-us/docs/integrate/get-started/auth/oauth
There is no way to do this for now:
Right now, Visual Studio Team Services only support the web server
flow, so there's no supported way to implement OAuth for Visual Studio
Team Services from an app like a phone app, since there's no way to
securely store the app secret.
As an alternative way, you can use Basic Authentication and ask your users enable "Alternate authentication credentials" and then use the alternative credential to authenticate to VSTS API.

How do I log into a web service that was auto-generated by Azure Mobile Web Services?

Microsoft's Azure Mobile Web Services lets you download a .NET or JavaScript Service and a client that talks to the Service. These are written in C#, or JavaScript. I chose to get one in C#. There is are several parts in the generated solution
A Windows 8.1 desktop client (yourname.Windows)
A windows mobile client (yourname.WindowsPhone)
A Azure Mobile Web Service (yournameService)
A shared .net assembly named (yourname.Shared)
You can right click on yournameService and click Publish and it takes you through a wizard which publishes your application directly from Visual Studio to an Azure server. At some point in the wizard it establishes automatically some rather complex credentials (because you have already logged into an Azure web subscription). Generally you can just click Next, Next, and get it published.
Now you have a webservice, which opens up in your web browser, but which requires you to log in. What I want to know is, how do you know the user name and password used for this login?
http://yourapp123.azure-mobile.net/help
Then you click "Try it out", and a web browser authentication dialog pops up.
Why is this a problem? So far as a user I have input:
My Visual Studio login credentials,
My connection to Azure (perhaps same, perhaps different as visual studio login)
During wizard I've determined login credentials to publish to Azure, using values I have no idea where they came from, and so I left them alone. These seem to be the only credentials I had any opportunity to enter, and any change from the defaults renders the wizard inoperable, so I'm sure that's not where I enter my user and password.
I created a username and password when I created the Mobile WebService, and these do NOT work when I try to log in.
Leave the user name blank. And put in your application key as password. You can find your application key from your Azure portal > Mobile service > manage keys.
The reason being is that AMS uses a Zumo header to decide proper authentication. Which is what the application key is used for. So it's making sure only people or applications which has the application key can access the web service. Hope this helps.

Windows authentication in SilverLight Application (not Silverlight Business Application)

I am trying to add Windows authentication to an existing website that I have created. All information that I have read regarding using Windows authentication in silverlight requires that you start with the Silverlight Business Applicaion template instead of the Silverliight application template. I already have a website that I started writing using the Silverlight Application template. How can I add windows authentication to this existing website?
If your application is hosted in IIS and this is a intranet site, you just need to set the application in IIS authentication method to Windows Authentication, then when the client tries to load the SL App a 401 challenge will trigger asking the user to enter in his/hers credentials. You can also set IE to pass with windows credentials to the server when the site is loaded.
I have had spent quite a bit of time tweaking various properties to get the right functionality that i am looking for (especially with machine names being fully qualifies or not) but basically that's one thing to keep in mind when debugging this is that machines names play a role in how the server interprets a client trying to access the server.

Categories

Resources