CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 10/17/2006 9:59:17 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 19 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
misuk11
Asp.Net User
querystring username and password10/17/2006 9:59:17 AM

0/0

I have a simple webpage that I want to protect with a username and password.  I dont need to use information stored in a database as there will only ever be one username so Ive put it in the web.config file.  Heres an example of my settings. (I dont need a login page either as i just deny access)

<authentication mode = "Forms">

<forms loginUrl="NotAllowed.aspx" protection="All" timeout="90">

<credentials passwordFormat = "Clear">

<user name ="abc" password = "123"/>

</credentials>

</forms>

</authentication>

<authorization>

<deny users = "?"/>

</authorization>

I basically want to put the username and password in the URL as such

http://mywebsite/default.aspx?u=abc&p=123

I know this is not the most secure method (far from it) but its only meant for denial of any attempted aunauthorised opportuinistic access by typing in the url.

I then have this in my code behind

protected void Page_Load(object sender, EventArgs e)

{

if (FormsAuthentication.Authenticate(Request.QueryString["u"],Request.QueryString["p"]))

{

FormsAuthentication.RedirectFromLoginPage(Request.QueryString["u"], false);

}

else

{

Response.Redirect("NotAllowed.aspx");

}

TextBoxUsername.Focus();

if (!IsPostBack)

{

TextBoxDate.Text = DateTime.Now.ToLongDateString() + " : " + DateTime.Now.ToLongTimeString();

}

}

 

this doesnt seem to be working though, can anyone give me some pointers ?

 

tia.. mark.

Fredrik N
Asp.Net User
Re: querystring username and password10/17/2006 10:39:00 AM

0/0

Why don't you simply use the basic feature out of the FormsAuthentication?

If you aren't logged in, no one will get access to the pages under your project. They will by default be redirected to a login page require them to login.

Take a look at the following article: http://www.15seconds.com/Issue/020220.htm


/Fredrik Norm?n NSQUARED2
Microsoft MVP, MCSD, MCAD, MCT

Cornerstone

My Blog, ASP.Net 2.0 etc
misuk11
Asp.Net User
Re: querystring username and password10/19/2006 11:09:34 AM

0/0

Hi Frederik

I dont want users to have a login page as they will be accessing this page from a secure portal and they wont want to login again thats why I want to pass a username and password in the url and log them in programmatically.  I know this isnt the most secure method, but this page is hosted outside their portal so I cant use their security.  If anyone knows of a better way I'd be very interested.

 

regards mark.

 

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Tomcat: The Definitive Guide Authors: Jason Brittain, Ian F. Darwin, Pages: 476, Published: 2007
Sams Teach Yourself E-Commerce Programming with ASP in 21 Days Authors: Stephen Walther, Eric Richardson, Jonathan Levine, Pages: 603, Published: 2000
Hacking the Code: ASP.NET Web Application Security Authors: Mark Burnett, James C. Foster, Pages: 447, Published: 2004
Hacking Exposed Web 2.0: Web 2.0 Security Secrets and Solutions Authors: Himanshu Dwivedi, Rich Cannings, Zane Lackey, Pages: 258, Published: 2007
Dreamweaver MX 2004: The Complete Reference Authors: Ray West, Tom Muck, Pages: 958, Published: -1
Advanced PHP Programming: A Practical Guide to Developing Large-scale Web Sites and Applications with PHP 5 Authors: George Schlossnagle, Pages: 650, Published: 2004
Tomcat 技術手冊 Authors: unknown, Pages: 0, Published: -1
PHP Hacks: Tips and Tools for Creating Dynamic Web Sites Authors: Jack D. Herrington, Pages: 443, Published: 2005

Web:
Putting username/password info in the URL Querystring - Derik ... Mar 25, 2008 ... Putting username/password info in the URL Querystring. Today a friend forwarded me a URL for a software tool that his department just ...
querystring probelm? - ASP.NET Forums You can however use querystring for validation of a username or password. Example (not a good scenario):. A user is prompted for username and password, ...
How to implement Querystring authentication - Stack Overflow Each recipient/ customer is also a user with a username/password that ... break apart the query string easily while still having the user name and password ...
Building a Basic Flash MX Page with ASP.NET and SQL Server must enter username and password"); Response.Redirect("error.aspx?e=" + errorMsg + ""); } } if(Page.IsPostBack) { if(Request.QueryString["userName"] == null ...
ASP QueryString/POST data queries - GameDev.Net Discussion Forums My first query is, is there a proper way to build a query string to be sent ... I don't want the username and password in the QueryString! ...
ssh query string and password Like when i login into some machine with ssh username@hostname i want to add password in the query string itself (basically i ..
Email Password after user answers a personal question ... 4.1 Select the "username" text box, and enter <% = Request.QueryString("username ") %> into the Initial value field. 4.2 Select the "password" text box, ...
create url with username and password - ASP You need to know the varables used to captuer the username and password and if they are captuered from the querystring or a form. ...
Open a URL with username and password on click of button : url ... QueryString("username") and Request.QueryString("password") to collect the values. That is of couse hypathetically speaking if you have Microsoft's IIS as ...
Redirecting if there is no query string - WebDeveloper.com A query string (to me) is "?key=value&anotherKey=anotherValue". ... getElementById("Password"); if (UserName.value=="WD") { if ...




Search This Site:










topmenurepater in master page

ajax problem

regarding navigate url in dnn

any ideas for a good forums module..

impersonation

return error code

how set copy local for newly added reference of a website project in vs 2005

dnn xxl 1.0.9 conversion back to normal dnn portal

menu control and parent/child page problem.

using vbscript class in .net

module definition add in dnn 3.1

java error with 2.1.2?

security

exception handling, ajax based call.

parser error

access classes stored in separate directory from aspx.cs page

location of project files for new web app

how can i add itm from datalist

to make dotnetnuke the killer applications

drop down

how to switch themes from a page not at top-level

custom control?

does not exist in the database

dnn2.1.2 - log behavior

email error

uploading images w/ ftb in 1.0.10d code

refering the .net 2.0 assembly in .net 1.1 framework

personalization.canentersharedscope

login status control only points to page in root

language selection

 
All Times Are GMT