System.ArgumentException while setting HttpContext.Current.User

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nikky85
    New Member
    • Sep 2010
    • 1

    #1

    System.ArgumentException while setting HttpContext.Current.User

    Hi,

    I am trying to configure one http module(a vb module) on MOSS site.
    In this module I have entry like below:
    Code:
    Dim roles As String() = Nothing
    Dim webIdentity As New GenericIdentity(OracleUser, "Form")
    Dim principal As New GenericPrincipal(webIdentity, roles)
    HttpContext.Current.User = principal
    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(HttpContext.Current.User.Identity.Name.ToString, False)
    Due to this I am getting 500 internal server and exception on browser is: Exception of type 'System.Argumen tException' was thrown.
    Parameter name: encodedValue


    If I comment "HttpContext.Cu rrent.User" related two lines then it redirect to form login.

    please let me know if there is anything wrong related to these settings.
    Last edited by Frinavale; Sep 9 '10, 01:26 PM. Reason: Please post code in [code] .... [/code] tags. Added code tags.
  • mzmishra
    Recognized Expert Contributor
    • Aug 2007
    • 390

    #2
    There are couple of posts on this.Please refer them
    http://blogs.msdn.com/b/kaevans/arch...oint-2010.aspx

    Comment

    Working...