RE: 2005-FormsAuthentication, Httpcontext.current.user is always nothi



I am usingit for Oracle, also the interesting is that i am able to access the
Httpcontext.current.user in the Page, but i the global.asax it is always
nothing.

I have already developed the code in 2003, which is working fine.
Now the new project is developed in 2005, and am copying the same code.
I don't understand why, i can't access it in global.asax, as i need to add
roles.

I understand that on the first request it will be nothing, but it is nothing
even after authentication and on every subsequent request, and at the same
time i am able to
access httpcontext in the other page except in global.asax.

I don't want to go for provider model.
--
n


"ns" wrote:

I am using visual studio 2005, i manually addded global.asax.vb and changed
global.asax to use the code behind.

When i step into the authenticate request, i get the
HttpContext.current.user as nothing always.

AM i missing anyhting ?, has the implementation of forms authentication
changed in
Visual studio 2005.

What are the things i should look at.

I am always getting HttpContext.current.User as nothing.




Imports Microsoft.VisualBasic
Imports System
Imports System.Web
Imports System.Web.SessionState
Imports System.Security.Principal
Public Class [Global]
Inherits System.Web.HttpApplication

Private Sub Global_AuthenticateRequest(ByVal sender As Object, ByVal e
As System.EventArgs) Handles Me.AuthenticateRequest
Dim UserName As String = ""

Try
UserName = HttpContext.Current.User.Identity.Name.ToString
Catch ex As Exception

End Try

End Sub
End Class

--
n
.



Relevant Pages

  • Re: 2005-FormsAuthentication, Httpcontext.current.user is always nothi
    ... The problem is that the authentication principal won't get set until the ... If you are using the Login control, you can use the UserName property to ... When i step into the authenticate request, ... Imports System.Web.SessionState ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HTTP - basic authentication example.
    ... or *never* knowing the realm..) ... This is called authentication and is implemented ... requests a web page it sends a request to the server. ... consists of headers with certain information about the request. ...
    (comp.lang.python)
  • Re: Each HTTP object being requested twice (401 then 200 responses)
    ... Authentication" and the web.config authentication setting is ... Authorized because the request was made anonymously. ... requests the same object a second time it uses kerberos; ... Kerberos tokens should not be regenerated for every request. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Each HTTP object being requested twice (401 then 200 responses)
    ... Authentication" and the web.config authentication setting is ... Authorized because the request was made anonymously. ... requests the same object a second time it uses kerberos; ... Kerberos tokens should not be regenerated for every request. ...
    (microsoft.public.inetserver.iis.security)
  • Re: HTTP_AUTHORIZATION header
    ... I use WFetch to make a Basic authenticated POST request against my CGI EXE ... Nitpick on your stated understanding of authentication protocols - ... header is not expected for every request for NTLM ...
    (microsoft.public.inetserver.iis.security)