Showing posts with label authentication. Show all posts
Showing posts with label authentication. Show all posts

Thursday, March 29, 2012

Passing values between pages using Forms Authentication

I want to know how can i pass a value from my database to another page using Forms Authentication.

In this example:

1Sub Logon_Click(ByVal senderAs Object,ByVal eAs EventArgs)Handles Submit1.Click23Dim objConnectionAs Data.SqlClient.SqlConnection4Dim objCommandAs Data.SqlClient.SqlCommand5Dim usernameAs String6 Dim passwordAs String7 Dim strSQLQueryAs String8 Dim RecordCountAs Integer910 username = userTextBox.Text11 password = passTextBox.Text1213If Len(Trim(username)) > 0Then14 objConnection =New Data.SqlClient.SqlConnection("Data Source=localhost;" _15 &"Initial Catalog=web_dados;User Id=sa;Password=platinum;" _16 &"Connect Timeout=15;")1718 strSQLQuery ="SELECT * FROM conserto WHERE web_user ='" & username & "' AND web_pass = '" & password & "' "19 objCommand = New Data.SqlClient.SqlCommand(strSQLQuery, objConnection)202122 Try23 objConnection.Open()24 RecordCount = CInt(objCommand.ExecuteScalar())25 Catch ex As Exception26 Finally27 objConnection.Close()28 End Try2930 If RecordCount = 0 Then31 Msg.Text = "Identificação de conserto ou código de acesso inválido."32Else33 FormsAuthentication.RedirectFromLoginPage _34 (userTextBox.Text, Persist.Checked)35End If3637 objConnection.Close()38End If394041 End Sub42

I want to store the value of the field named <numero> of the database, and when the user authenticates, i want to print that variable in the default.aspx page.

You can use a Session variable to do so. If you are using ASP.NET 2.0, then you could use a Profile object too.

Does this help?

Regards


i've just tried to use sessions, but when the user autheticates and are redirected to the default.aspx page, it lost the session value.

1 username = userTextBox.Text2 password = passTextBox.Text3 Session("USERNAME") = username45If Len(Trim(username)) > 0Then6 objConnection =New Data.SqlClient.SqlConnection("Data Source=localhost;" _7 &"Initial Catalog=web_dados;User Id=sa;Password=platinum;" _8 &"Connect Timeout=15;")910 strSQLQuery ="SELECT * FROM conserto WHERE web_user ='" & username & "' AND web_pass = '" & password & "' "11 objCommand = New Data.SqlClient.SqlCommand(strSQLQuery, objConnection)121314 Try15 objConnection.Open()16 RecordCount = CInt(objCommand.ExecuteScalar())17 Catch ex As Exception18 Finally19 objConnection.Close()20 End Try2122 If RecordCount = 0 Then23 Msg.Text = "Identificação de conserto ou código de acesso inválido."24Else2526 FormsAuthentication.RedirectFromLoginPage _27 (userTextBox.Text, Persist.Checked)

in this code in the default.aspx it doesn't display any value.

1Sub Page_Load(ByVal SrcAs Object,ByVal eAs EventArgs)2 userLabel.Text = Session("USERNAME")3End Sub4

why?

Wednesday, March 21, 2012

Passport authentication -- how can I debug it?

Is it possible to debug a web site with password authentication in PreProduc
tion mode?
Here is what I have done:
- Installed Passport SDK
- Set Password authentication in web.config
- Created PassportIdentity object in the asp.net web page
Here is what is happening:
- LogoTag returns me a url to ms web site for sign in.
- Image for the Sign In button is not shown
- When I click on hyperlink I get redirected to a return URL which I specifi
ed the Passport Manager
- I don't get a ticket
I guess it is how it is supposed to work, question though, is how can I debu
g this page with a real passport web site?
I would like to run my code in the debugger and to be redirected to a real p
assport login page, see real ticket, user profile, etc.
Is it possible to do on my local IIS or I need a public ip?
I know there is a process of compliance review, but we are not there yet, ju
st trying to make sense of all it..
Thank you,
-Stan
(I hope this is the right ng to post)Hi Stan,
Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Passport authentication -- how can I debug it?

Is it possible to debug a web site with password authentication in PreProduction mode

Here is what I have done

- Installed Passport SD
- Set Password authentication in web.confi
- Created PassportIdentity object in the asp.net web pag

Here is what is happening

- LogoTag returns me a url to ms web site for sign in
- Image for the Sign In button is not show
- When I click on hyperlink I get redirected to a return URL which I specified the Passport Manage
- I don't get a ticke

I guess it is how it is supposed to work, question though, is how can I debug this page with a real passport web site

I would like to run my code in the debugger and to be redirected to a real passport login page, see real ticket, user profile, etc

Is it possible to do on my local IIS or I need a public ip

I know there is a process of compliance review, but we are not there yet, just trying to make sense of all it.

Thank you

-Sta

(I hope this is the right ng to postHi Stan,

From your description, you're wondering whether its possible to provide a
local Passport auhtentiation server which can accept the login request and
do the authentication processes, yes?

Based on my research, the passport authentication is also cookie based and
all the authenticatoin works are processed by the certain internet Passport
Login servers. It authenticate the requests and then set the certain
clientside cookie. And our works in ASP.NET web application is just
configure the certain passport authentication and then use the Passport
Authenitcation provider which can help check the passport authentciatoin
cookie(token) and set the proper Identity and Principle in the requesnt.

So it seems that all the work is done by the remote passport server rather
than ourself. Do you think so?
IN addition ,here is the certain reference on ASP.NET Passport
Authentication Porvider in MSDN:

#Passport Authentication Provider
http://msdn.microsoft.com/library/e...PassportAuthent
icationProvider.asp?frame=true

Hope also helps.Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Hi Stan,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Passport authentication

The company I work in is switching to ASP.NET 2.0. We have seen that there
is built-in support for Microsoft Passport authentication and we're
considering it as an optional way of authenticating users of our web
product. I was unable to find on Microsoft site any information regarding
fees for using it. Is it free of charge or a company that uses Microsoft
Passport authentication in their product must pay some fee to Microsoft?
Best regards
Lukasz GlazYou can learn a little more from:
http://www.devx.com/security/Article/17483
but it is a hosted service which Microsoft sells. Personally, I think
Passport has been a failure for Microsoft and is only useful to it on it's
own sites (hotmail/msn/...). Here's an entry from wiki
"Having failed to gain market acceptance, Microsoft has recently stated they
will stop usage of Passport for entities outside of its own operations.
Despite media reports that Microsoft is phasing out the technology,
Microsoft rolled out a major update to the Passport service in May, 200"
So I'm not even sure if you can still buy it as a service...
Karl
--
http://www.openmymind.net/
"Lukasz Glaz" <lglaz at dantek com pl> wrote in message
news:esN51OuMGHA.3496@.TK2MSFTNGP14.phx.gbl...
> The company I work in is switching to ASP.NET 2.0. We have seen that there
> is built-in support for Microsoft Passport authentication and we're
> considering it as an optional way of authenticating users of our web
> product. I was unable to find on Microsoft site any information regarding
> fees for using it. Is it free of charge or a company that uses Microsoft
> Passport authentication in their product must pay some fee to Microsoft?
> Best regards
> Lukasz Glaz
>

Passport authentication

The company I work in is switching to ASP.NET 2.0. We have seen that there
is built-in support for Microsoft Passport authentication and we're
considering it as an optional way of authenticating users of our web
product. I was unable to find on Microsoft site any information regarding
fees for using it. Is it free of charge or a company that uses Microsoft
Passport authentication in their product must pay some fee to Microsoft?

Best regards
Lukasz GlazYou can learn a little more from:
http://www.devx.com/security/Article/17483

but it is a hosted service which Microsoft sells. Personally, I think
Passport has been a failure for Microsoft and is only useful to it on it's
own sites (hotmail/msn/...). Here's an entry from wiki

"Having failed to gain market acceptance, Microsoft has recently stated they
will stop usage of Passport for entities outside of its own operations.
Despite media reports that Microsoft is phasing out the technology,
Microsoft rolled out a major update to the Passport service in May, 200"

So I'm not even sure if you can still buy it as a service...

Karl
--
http://www.openmymind.net/

"Lukasz Glaz" <lglaz at dantek com pl> wrote in message
news:esN51OuMGHA.3496@.TK2MSFTNGP14.phx.gbl...
> The company I work in is switching to ASP.NET 2.0. We have seen that there
> is built-in support for Microsoft Passport authentication and we're
> considering it as an optional way of authenticating users of our web
> product. I was unable to find on Microsoft site any information regarding
> fees for using it. Is it free of charge or a company that uses Microsoft
> Passport authentication in their product must pay some fee to Microsoft?
> Best regards
> Lukasz Glaz

Passport Authentication

hi,

I got little problem with authenticating .NET passports on my site.

I installed the SDK, created new application at microsoft, made some pages on site, ....

It looks like loggin in using a passport account works but it says im still not authenticated

Passport.HasTicket << before login = false, after login = true
Passport.IsAuthenticated <<< both cases false :( :( :(

I can find the problem for this :(
Because its for a large ecommerce site, i want to use passport authenticationI dont know if your problem is related to this, but did you know that you should buy the Passport license from MS? Read this thread (http://www.vbforums.com/showthread.php?s=&threadid=244500).

Passport Authentication in ASP.NET

Hi All,

I want to implement the .Net Passport Authentication in my ASP.NET web
application.

I have installed the Microsoft Passport SDK 2.5 on my machine. I have
also registered my profile (email address and company profile) while
downloading the Passport SDK.

I have not yet received the SiteID and the Key from Microsoft for
registering my Web Application for Passport Authentication.

I want to know the further steps involved in implementing the Passport
Authentication.

Can anyone help me?

Thanks in advance.

SudhirGo back to the Passport site and find an email for a contact person. I had
to do this with MapPoint .NET (now MapPoint Web Service) to speed up the
process.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"Sudhir Pai" <sudhir_pai@.rediffmail.com> wrote in message
news:8883ea5a.0307062137.48cc1141@.posting.google.c om...
> Hi All,
> I want to implement the .Net Passport Authentication in my ASP.NET web
> application.
> I have installed the Microsoft Passport SDK 2.5 on my machine. I have
> also registered my profile (email address and company profile) while
> downloading the Passport SDK.
> I have not yet received the SiteID and the Key from Microsoft for
> registering my Web Application for Passport Authentication.
> I want to know the further steps involved in implementing the Passport
> Authentication.
> Can anyone help me?
> Thanks in advance.
> Sudhir

Passport SDK not avaliable anymore?

Hi,

I would want to use .Net Passport authentication for asp.net websites.

According to Msdn (VStudio 2005), the passport SDK has to be downloaded first. But the link given in msdn is no longer valid.

I searched the net and microsoft's website but cant find any place to download the passport SDK.

Has microsoft withdrawn support for the .net passport SDK?

Are there any links to download the SDK?Windows Server 2003 includes the SDK but have you checked these links yet?

http://www.microsoft.com/net/services/passport/developer.asp

http://msdn.microsoft.com/msdnmag/issues/02/09/Passport/

Seems they have retired the 2.5 SDK and have changed the name to Relying Party Suite and required you to register and subscribe to it.

http://www.dotnetfire.com/news.aspx?newsID=52615
Hi RobDog,

I've tried the links and after some furthur surfing, you are right. MS has withdrawn support for the passport SDK.

Unfortunately, the Relying sdk requires a rather large annual fee to be paid :mad:

Thanks for the reply though :)

Passthrough Authentication?

Hello,

I am setting up a secured website on an intranet for a client. In order to authenticate to the web page, the client would like to pull the userid and domain from the local workstation. Then I would query a db table to see if that user was in there. The thinking is that if the user is authenticated in the domain, they have access to the website.

So my question is - how do I pull the userid and domain name from the workstation? I'm guessing I'll have to code some java script. However, if there was a way to pull this info from the server, that'd be best.

Anyone know?

Thanks,

PardoTry

Request.ServerVariables("AUTH_USER")

hope this helps,
sivilian
Great - will try!