Asp.net webservice: prompt for finger print reader - c#

I am using mootools library to call webservices in an asp.net application. one of the web services is used to create new users in the database. I create an html dialog with mootools where the user can input his details, username, password, etc etc. upon submitting, the web service is called. We have a fingerprint scanner with a .net SDK. Is it possible for me to prompt the user for the finger print inside the webservice just before saving the details the user inputted in the html dialog?
Please note that the finger print scanner and the asp app will be available on one computer so to create new accounts users will go near the admins using this pc.
I am thinking of something like the below:
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string NewMember(parameters)
{
JavaScriptSerializer js = new JavaScriptSerializer();
try
{
Database db = new Database();
//Prompt and get finger print from user
//create user
db.CreateNewMember(parameters with finger print code)
Thanks

No. You cannot use a web service to invoke your fingerprint reader directly. You'll need something client side (javascript/mootools/activex) to handle that.

One option (not too good) is if you can create a WPF/WinForms application using that fingerprint SDK and invoke that application from your WebService as you described above. For example:
insert user details into the database
execute your finger print reader app with user id as an argument
wait until finishes the job (scan/save fingerprint data to a temporary place with user id)
update your database record with the fingerprint details (read then delete from the temp place)
Or better if you just insert your user details into the database with empty fingerprint data using your WebService. Then later update your users record with fingerprint data using an independent WPF/WinForms application with direct DB access as it is won't block your WebService.

I asked this question before having the finger print at hand. Now that I have the finger print scanner at hand and used it with C# I realized that I do not need to store any finger print id in the database. the finger print scanner stores everything in it memory it just returns and id for the user.
I am going to create a windows app with c# for finger print events, from those events I get the id of the user which will match that in the database and from the app I will open or close the gate so practically no need to have it in the web app which is used to manage users only. When a new user is created on the web app I will show the id to the admin so he can add a finger print with same id to the user.

Related

How do you query the session name and ID number via ASP>

With the command prompt it is possible to query the sessions for a server, as shown here (https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/query-session).
With an aspx file you can get a unique sessin ID by using:
System.Web.HttpContext.Current.Session.SessionID
Also, with an aspx file you can get the IP address by using:
Request.UserHostAddress
Is it possible with an aspx file to obtain the session name (e.g. console, rdp-tcp#10) and the corresponding ID number (integer)? I am trying to integrate an old piece of software that records a terminal/server ID number as part of key to record a user's request in a database.
Background:
I have a file with the extension .aspx from around ~2011 that integrates an enterprise database with software delivered by a web browser (software as a service?). This file contains a call to Request["sessionId"] which I don't think returns anything as the key "sessionId" may nolonger be supportted? For the file logic, all I need to know is whether the user has the "console" session type or not. This aspx file is called by a batch file whenever a user presses one of the buttons on the enterprise database.

How to share attachments from user to agent (Human handoff) using Bot?

i have bot made using c#. It has the feature of human off. We have integrated the solution provide by tompanna of human handoff where a agent can talk to single user at a time.Here the link of solution we used for human handoff https://github.com/tompaana/intermediator-bot-sample. Our bot is working fine and able to talk with agent with the help of this solution but major issue come when a user want to share image or any kind of attachments from user to agent or from agent to user. The bot show that image is send but user is not able to see it. Simpler case happen in the case of agent.
Image of agent while sending a attachment to user.
And also the image of user ,unable to see the image send by agent.
The sample which you are using for Human HandOff has not been updated over a year, so it gets difficult to be able to find solutions for supporting various features pertaining to the same. However, going through the sample issues, there has been a similar issue in which the sample does not support emojis, images or files to the receiving user. If a user sends any of the above mentioned features, the receiver will get a blank message as it supports only text messages.
Th tentative solution suggested by a user is to create a simple method extension to send image/file messages.You could go ahead and give it a try to see if it works for your case.
Hope this helps.
You need to edit the source code of the library to achieve what you are trying.
In this MessageRouter file , method RouteMessageIfSenderIsConnectedAsync , you can access message.Attachments , then pass it as a parameter to SendMessageAsync in line 432, then from SendMessageAsync in line 160 , you can pass it to CreateMessageActivity method and then in file ConnectorClientMessageBundle , you can access the attachment and attach it to messageActivity.

IBM.Data.DB2.iSeries Login to DB2 - Disable IBM Login Window

I'm using the IBM.Data.DB2.iSeries.dll to connect to a IBM DB2 Database.
It works fine, connection is open and all operations can be made.
But when you start the conn.open() method, IBM sends a warning - window to the user that his password expires. I suppose this window comes directly from Client Access.
class Program
{
static void Main(string[] args)
{
string connString = "DataSource=SYSTEM;UserID=USER;Password=PASSWORD";
iDB2Connection conn = new iDB2Connection(connString);
conn.Open();
}
}
I've found this thread: JT400.jar Disable Login Screen and how to disable this behaviour with the jt400.jar, but nothing about the IBM.Data.DB2.iSeries.dll.
Is there any possible way to hide or to block this window in C#?
The following IBM Support article suggests using System i Navigator to set the "prompting behaviour". You can try to see whether this helps.
http://www-01.ibm.com/support/docview.wss?uid=nas8N1017433
To change user ID and password prompting behavior within Access for Windows is through the Navigator, do the following:
1. Open the System i Navigator.
2. Right-click on the System name. and click on Properties.
3. Click on the connection tab, and select one of the following options:
o Specify Prompt every time. This prompts for a password every time a connection is made to the operating system.
o Specify Use default user id/password prompt, as needed. This prompts for an initial signon and does not prompt again during a Microsoft® Windows® session.
o Specify Use windows user id/password (never prompt). This does not prompt for a user ID or password and uses the Windows logon to sign on the operating system.
o Specify Use Kerberos. This will use the Windows Kerberos ticket for authorization and requires EIM setup on the operating system.
You have the Navigator installed right ?
There is an IBM Support article for the connection string for OLE DB. The .Net connection string properties is possibly similar. BUT, even here there are no details about the suppressing the dialog box from the application.
OLE DB connection properties:
http://www-01.ibm.com/support/docview.wss?uid=nas8N1017400
The following list contains all of the custom properties that are available for the OLE DB providers shipped with iSeries Access for Windows (IBMDA400, IBMDARLA, and IBMDASQL). The release at which each property was added is indicated. For more information about any of these properties, consult the OLE DB technical reference that can be found in the Programmer's Toolkit included with iSeries Access for Windows.

C# create tor hidden service trough controlport

So I'm making a small chat application like ricochet, but then in C# and I succesfully connect to the tor controlport and create a hidden service id and private key, however after that point i got stuck, I send ADD_ONION NEW:BEST Port=8946,127.0.0.1:8946\r\n to the tor control port and it answers with hidden service id and private key and code 250. But what should I do to make it automatically run the service? I tried googling it but couldnt find anything and all examples are python or c++ if someone could point me in the right direction that would be great. Also, im using Knapcode.TorSharp, so the tor installation is NOT persistent, the user has a profile file where the key etc are saved and it should start from there.
Thanks in advance
When you call ADD_ONION, the hidden service starts running immediately (accessible once it can publish the Hidden Service descriptors and establish circuits [usually within a minute or two]).
If you want those services to start again automatically on subsequent runs (for a non-persisting Tor installation), then you'll need to programatically make similar calls to ADD_ONION when your application restarts and detects that private keys are saved to the profile.
You can re-create hidden services using existing keys with syntax like:
ADD_ONION RSA1024:*PKEY_GOES_HERE* Flags=DiscardPK Port=8946,8946
When you call ADD_ONION the first time, the response should look something like:
250-ServiceID=abcdefg123456
250-PrivateKey=RSA1024:MIICXAIBAAKBgQC91z4mjpNF5ddRL6jm7rnmgwSiQ6dNXF1Fo8sz1wOsGqWKgE4C6Bd3KT+zgQgXJlioIJOCEP9D0b/qlPCvEiGG3/fPEn1+Zpf5N4oNRI+in7J2m3xihhgAinbscJ0vM+1vfnRLlMrtYdE9J5aKle+t+OC6ZoXTxzPZRZkmXtqVpp8QIDAQPXAoGBAK7oh8zChBJch5u3i6jpvsIRaM2QA68VMKKfHPOwYSPKkUcgm7+10xjpGlXqxmd93yVYjk/CFU6JDIe3nmHPFK82BtPgyEMRtmVmcunS262Ead/ffpzAErBSdihOF7zO/wGjGgIaMW9Bhy69aK5LcNUB30Iu9+MWG62xz8tTgcEhAkEA8QNKMyKdRUbgGc9Gv1n8JtMs0Af/a/OHozdn1ywvHxw7mzahF936gqHIdg67XLtIj5TaUSM/44OoEvvURnG7QJBAMmlVttRd8y+/FnA6dPkesQMpPw+ipHLNUrf7qPrX3py670vLbprWDNYCOn6oaxoRtl/iRXPI5CgjMXmnu356pUCQDnWD0VMJi+MvZSUACbZXwP2ApP1bHfla3I7Xaezh5oDxtoAd0PS4STh1+HQUPvQW4WfLUcSsz9UaMAg2NI+fFUCQc7D1PVW7sqSGBth3jXE+3+H6WY2iy8Z1Ji+l2KRdJ8IiIOWdfcgUpMNzZV8jc7Y9Cm5p5l2wy7kjfGADyYBCXkCQD9fnmVMlUO1xITfW8K+pAf6FPcvfo8J0rpWHEhG4CxjFw4s4s9Mzjme1e17YnfK21CNIOxd2bkqVI4j4o=
250 OK
You'll want to save what it gave back in PrivateKey, and use this value to restart the hidden services the next time you run your application.

how to handle static variables when application (desktop c#) is configured on LAN

I built an c# desktop application for attendance
application is working fine when i run it on single machine and all is good..
but now issue is ... my boss want this application should work on LAN and every client can access application from server
but i used static variables which store some values at run time and then i utilized these values in next forms.
here is example..
on login form username is stored in static variable as
public static string username;
username = txtUser.Text.Trim().ToString();
and in next form which is Home Page this user name is used as
lblName.Text = Login.username;
here lblName is name of label and Login name of Login form
when i configure this application on LAN then may be at same time more than one user will be logged in and want to access application then each user should see his/her own username....
e-g abc is user 1 and xyz is user 2
if both are logged in at same time then i want abc to see
lblName.Text = "abc"
and xyz to see
lblName.Text = "xyz"
so what should i do to handle this job?
i need not to mix up any information between users...
i used c# windows app.
thanks in advance.
I assume you use static variables on server-side, right?
So, your issue happens because you use static variables.
Static variables are consistent in your class during all period of application is running. And that fields are shared between ALL processes which can use that class. Static variables was designed for this.
As a possible quick solution you can generate something like unique session Id. During client logs in to your system - you need just generate that id on client's side, send it with login information to server. In case of successful authentication server will store id in cache a key. And value of the cache can be object with user's name and other needs.
Every request to your server should be followed with that id. So your server will always know which user it is.
If you need more detailed answer please provide more information about app network structure and it's modules.

Categories