asp.net data authentication

K

Kdeutsch

My requirement is this, I need to be able to have personnel sign data with a
smart card. For instance I would like to place a text box and a button on a
page and have a user pick on the button provide the pin for smart card and it
will put their digital signature in the textbox. The reason for this is for
signing payrolls or authenticating other typers of data. Can this be done in
asp.net and how.
Thanks
 
J

Joe Kaplan

Signing data with a private key requires access to the private key and that
is only available on the client application. As such, you will need some
code running in the browser itself to actually sign the data you want to
sign.

There are potentially a bunch of different ways you could do this (ActiveX,
..NET downloadable component, maybe script?), but you can't do it completely
with server side code.

Joe K.
 
L

Lars

Hi

I'm not sure what you mean by "private key". Is it within the database?

When it comes to payment over the Internet I always recomend you to use one
of the major payment services on the Internet. Such as www.Shareit.com,
www.Plimus.com or www.RegNow.com. The major reason is that these companies
are trusted by users. I would never go to a minor companies homepage and by
any thing with a credit card.

If it is for paying your affiliates www.RegNow.com can help you with this
to. They have components that can do the trick for you. Or ask your
affiliates for an IBAN account number so you can wire the money.

I have made money from programs available on the Internet since 1999. At
start I used Share but due to VAT laws in Europe where I live it was easier
to use Plimus and RegNow. They pay all the VAT for you customers so you
never have to think about VAT.

If you have to create your own page you might be interested in using Roles
on the pages. Create an account for each affiliate or customer then set the
role for each affiliate or customer to for example Affiliate or Customer.

I have users who are licensed users after payning through Plimus or ShareIt.
I have a role called Affiliate and one role called licensed. When the user
logs in using the login page the site knoe what kind of uer it is. So that
way my licensed users and affiliates have their own pages.

You can also create folders that are only for users in a specified role.


Here's one example how to write the Login page which I calle Account.aspx.
For some reason my ISP's ASP.NET server doesn't like script to be called
Login.aspx. The parameter RedirectURL should be set to the page you want the
user to return to. For example:

If the page ~/Licensed/Default.aspx calls the ~/Account.aspx script call the
stricpt the with the following parameter

~/Account.aspx?RedirectURL=~/Licensed/Default.aspx

If the user is logged in and is in the role Licensed.aspx the user ends up
on the page ~/Licensed/Default.aspx

In the Licensed folder place a file called web.config. I have written to
code for that page after the C# script.

If any one tries to access a page in the folder Licensed who doesn't have
the role Licensed the user will not reach the page.

========================

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class LoginPage : System.Web.UI.Page
{
protected void RedirectToPage()
{
try
{
String sRedirectURL = (String)Session["RedirectURL"];
String Name = User.Identity.Name;

if (User.Identity.IsAuthenticated)
{
if (User.IsInRole("Administrator"))
{
Response.Redirect("Admin/Default.aspx");
}
else if (User.IsInRole("Basic User"))
{
if (sRedirectURL == null)
{
Response.Redirect("Default.aspx");
}
else
{
Response.Redirect(sRedirectURL);
}
}
else if (User.IsInRole("Licensed"))
{
if (sRedirectURL == null)
{
Response.Redirect("~/Licensed/Default.aspx");
}
else
{
Response.Redirect(sRedirectURL);
}
}
else if (User.IsInRole("Affiliate"))
{
if (sRedirectURL == null)
{
Response.Redirect("Default.aspx");
}
else
{
Response.Redirect(sRedirectURL);
}
}
}
if (sRedirectURL != null)
{
Response.Redirect(sRedirectURL);
}
}
catch (Exception ex)
{
}
}


protected void Login1_LoggedIn(object sender, EventArgs e)
{
RedirectToPage();
}
}

========================



==== web.congig ==========

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<allow roles="Licensed" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

========================


Yours
Lars
 
J

Joe Kaplan

If you don't know what a private key is, why are you answering a question
about signing data with a smart card?

Joe K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top