LDAP Authentication on Windows Phone - c#

In a current project I would like to check if the user is the user it says he is (no private data involved). That project is mainly about Timetables at my university. As we have a LDAP Server and every Student has an account, i would like to authenticate against the LDAP Server but the System.DirectoryServices Assembly is not available on Windows Phone.
Does anyone have an idea how to realise the login expect for a workaround via a Webservice? WCF would not be an option, I could theoretically send the data to a Webservice and do the authentication via PHP but I would like to keep that functionality in the app.
Thanks in advance!

RESTful Web service would do what you want.
Have a web server running tomcat/windows IIS (depending on how you wish to implement it)
send request to the web service via HTTPS and then have the web server connect to the LDAP server to query it.

Have you tried using a 3rd party library like Novell's (http://www.novell.com/developer/ndk/ldap_libraries_for_c_sharp.html)? It comes with source and MIT license.

Related

Authenticate a Windows Desktop app to a Web API that uses JWT

I'm working on a Windows Desktop application that needs to authenticate to a Web API that uses JWT.
We are using the authentication based on if the end-user of the desktop client is successfully logged into their computers with a smart card. So if they are logged into their computers, we pass a specific piece of that data to our Web API to verify that value is in the database of the Web API, and then that particular data will use that to determine the roles. JWT works excellent and has no issues. We are accomplishing JWT via this article: https://auth0.com/blog/add-auth-to-native-desktop-csharp-apps-with-jwt/
Is there another way to make sure they are coming from our desktop applications and not hitting our API via another application in the network? Or do we not need to worry about that since they have been pre-authenticated into the computer itself.

Connect sql server with windows authentication over internet

i have c# windows form application which will connect to the ms sql server over internet connection.
i need to connect to it with entity framework to make may day good but , there is a problem with connection. i need to connect with windows authentication
i have connection string like that
Data Source=xxx.xxx.xxx.xxx[SQL INSTANCE];Initial
Catalog=mainCatalog;User ID=[userid];Password=[password];
as you know this is SQL Authentication.
what can i do to connect to the sql server with connection string which i can describe also windows authentication parameter to let me login.
Thanks.
As others have already commented, you cannot use Windows authentication from the internet. From the internet, your client cannot communicate with your domain controller, which is needed to get the encryption keys used in Windows authentication.
Even if you could, I would advise against exposing your SQL server directly on the internet anyway.
A better option would be to have your Windows Form application talk to a web service and have the web service talk to the SQL server instance. That way, you can put your SQL server behind a firewall and only allow your web service to query it. Your web service can use Windows authentication to talk to SQL Server (if they are installed in the same domain).
Your Windows Forms application can use a token based authentication protocol like OAuth2 to authenticate against your web service.

Authenticate against Exchange web service using existing credentials

We have a web application that use forms authentication against Active Directory. In the same domain we also have an Exchange server 2010, soon to be 2013.
My question is, I would like to use the Exchange server to send outgoing emails from the user account using Exchange Web Services(EWS). Is it possible to reuse the user authentication that is already done on the form to connecto the the EWS?
We are using c#
I haven't tried this myself, but it's covered here: Accessing internal Exchange web services from an external application through ISA server using forms-based authentication.

Winforms SagePay integration [duplicate]

I’ve been asked to integrate a windows form application with SagePay to take payments directly from the application. The SagePay documentation talks about ASP.NET so I’m not sure whether this is possible. Has anyone integrated a WinForm application with SagePay before? Is it possible?
I know some payment processors have a connection option where the payment part is hosted on a form on their server. You could try embedding a web browser control into your app to display the payment page.
Usually there is another type of connection option where you can send your information via HttpWebRequest, but I'm not sure that this would work as it requires SSL. Since you are running your app as a desktop client, I'm not sure what you would have available.
I am not sure this is possible given that sagepay needs to redirect users to Mastercard securecode or Verified by Visa, I think they would need to redirect to the bank which then redirects back to a supplied URL. I would think this needs to be within a browser environment.
You can post to urls and get back a response via .net objects and parse the results to display on a form.
You can also ask SagePay to create a Vendor account with 3d secure switched off. This allows you to take payments in house in your winforms app without the customers password however most card vendors if you bypass 3d secure will not protect you if someone calls and uses a card fraudulently.
However it can definitely be done.
You can normally post to secure servers from non secure pages so again this isn't usually an issue.

WCF security: looking for a very specific example

I'm having a problem where i want to get the users windows login information sent to IIS then from there sent to a WCF service hosted in a console application and then that service uses the credentials to go to a database and retrieve results.
i'm looking for an example on the web that does EXACTLY this but for the life of me can't find one. I can find a million example that
1. Give general information about WCF, Windows Authentication, Delegation, impersonation etc..
1. Uses the credential to go to a WCF service hosted in IIS and then to the database
2. Uses the credentials to go straight to a WCF service and then to the database
But I can’t an example going first to a regular webpage in IIS, then to a WCF service hosted in a console app and then to the database
Can anyone find this specific scenario?
Can you get current user under IIS? write Login method in WCF and pass that data to WCF service, use sessions, and require that Login should be called first, after all close the session

Categories

Resources