asp.net sqlmembershipprovider integrated security

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt MacDonald

    #1

    asp.net sqlmembershipprovider integrated security

    Hi all,
    I've been debating for a while (basically since asp.net 2.0 came out) on
    using the built in mebership classes to handle user management in my web
    apps. I seem to keep coming upon roadblocks that keep me from jumping in.
    Well this time is no different. While trying to use an asp.net
    sqlmembershippr ovider to create a new user, I get the following error:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Login failed for user 'DOMAIN\MACHINE NAME$'.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
    'DOMAIN\MACHINE NAME$'.

    Source Error:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): Login failed for user 'DOMAIN\MACHINE NAME$'.]
    System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    exception, Boolean breakConnection ) +739123
    System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    stateObj) +188
    System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet
    bulkCopyHandler , TdsParserStateO bject stateObj) +1956
    System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
    enlistOK) +33
    System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, SqlConnection owningObject) +170
    System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
    host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
    owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart) +349
    System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    Boolean redirectedUserI nstance) +181
    System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserI nstance)
    +170
    System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    owningConnectio n) +359
    System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
    owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +28
    System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    owningObject) +424
    System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    owningObject) +66
    System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    owningObject) +496
    System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    owningConnectio n) +82
    System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    outerConnection , DbConnectionFac tory connectionFacto ry) +105
    System.Data.Sql Client.SqlConne ction.Open() +111
    System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
    Boolean revertImpersona te) +84
    System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
    connectionStrin g, Boolean revertImpersona tion) +197
    System.Web.Secu rity.SqlMembers hipProvider.Get PasswordWithFor mat(String
    username, Boolean updateLastLogin ActivityDate, Int32& status, String&
    password, Int32& passwordFormat, String& passwordSalt, Int32&
    failedPasswordA ttemptCount, Int32& failedPasswordA nswerAttemptCou nt,
    Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDat e)
    +1121
    System.Web.Secu rity.SqlMembers hipProvider.Che ckPassword(Stri ng username,
    String password, Boolean updateLastLogin ActivityDate, Boolean
    failIfNotApprov ed, String& salt, Int32& passwordFormat) +105
    System.Web.Secu rity.SqlMembers hipProvider.Che ckPassword(Stri ng username,
    String password, Boolean updateLastLogin ActivityDate, Boolean
    failIfNotApprov ed) +42
    System.Web.Secu rity.SqlMembers hipProvider.Val idateUser(Strin g username,
    String password) +83
    System.Web.UI.W ebControls.Logi n.OnAuthenticat e(AuthenticateE ventArgs e)
    +160
    System.Web.UI.W ebControls.Logi n.AttemptLogin( ) +105
    System.Web.UI.W ebControls.Logi n.OnBubbleEvent (Object source, EventArgs e)
    +99
    System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +35
    System.Web.UI.W ebControls.Butt on.OnCommand(Co mmandEventArgs e) +115
    System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String eventArgument)
    +163
    System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
    eventArgument) +7
    System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
    sourceControl, String eventArgument) +11
    System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
    System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102



    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.507 27.832; ASP.NET
    Version:2.0.507 27.832

    Here's my configuration situation. I'm running .net 2.0 and sql server
    2005. I'm using integrated security in my connection string similar to
    "Data Source=SERVER;I nitial Catalog=DATABAS E;Trusted_Conne ction=True;". The
    applicaiton in IIS is running as a network level user that has db_owner
    access to the database in the connection string. The user is impersonated
    in the web.config using "<identity impersonate="tr ue"/>". The rest of the
    database access on the site works fine using the same connection string. I
    only get the error above when trying to do the membership functionality. It
    almost looks like when I use the classes that it drops the annonymous user
    and goes back to using a machine level account.

    Any help would be greatly appreciated.

    Thanks,
    Matt


  • Matt MacDonald

    #2
    Re: asp.net sqlmembershippr ovider integrated security

    Anyone have any thoughts on this?

    "Matt MacDonald" <mattsmac@hotma il.comwrote in message
    news:%23lHkG4Tq IHA.552@TK2MSFT NGP06.phx.gbl.. .
    Hi all,
    I've been debating for a while (basically since asp.net 2.0 came out) on
    using the built in mebership classes to handle user management in my web
    apps. I seem to keep coming upon roadblocks that keep me from jumping in.
    Well this time is no different. While trying to use an asp.net
    sqlmembershippr ovider to create a new user, I get the following error:
    >
    Server Error in '/' Application.
    --------------------------------------------------------------------------------
    >
    Login failed for user 'DOMAIN\MACHINE NAME$'.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.
    >
    Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for
    user 'DOMAIN\MACHINE NAME$'.
    >
    Source Error:
    >
    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.
    >
    Stack Trace:
    >
    [SqlException (0x80131904): Login failed for user 'DOMAIN\MACHINE NAME$'.]
    System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
    exception, Boolean breakConnection ) +739123
    >
    System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
    stateObj) +188
    System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet
    bulkCopyHandler , TdsParserStateO bject stateObj) +1956
    System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean
    enlistOK) +33
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTi meout, Int64
    timerExpire, SqlConnection owningObject) +170
    System.Data.Sql Client.SqlInter nalConnectionTd s.LoginNoFailov er(String
    host, String newPassword, Boolean redirectedUserI nstance, SqlConnection
    owningObject, SqlConnectionSt ring connectionOptio ns, Int64 timerStart)
    +349
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(SqlConnectio n
    owningObject, SqlConnectionSt ring connectionOptio ns, String newPassword,
    Boolean redirectedUserI nstance) +181
    >
    System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty
    identity, SqlConnectionSt ring connectionOptio ns, Object providerInfo,
    String newPassword, SqlConnection owningObject, Boolean
    redirectedUserI nstance) +170
    >
    System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions
    options, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection
    owningConnectio n) +359
    >
    System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ction
    owningConnectio n, DbConnectionPoo l pool, DbConnectionOpt ions options) +28
    System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection
    owningObject) +424
    System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection
    owningObject) +66
    System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection
    owningObject) +496
    System.Data.Pro viderBase.DbCon nectionFactory. GetConnection(D bConnection
    owningConnectio n) +82
    System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
    outerConnection , DbConnectionFac tory connectionFacto ry) +105
    System.Data.Sql Client.SqlConne ction.Open() +111
    System.Web.Data Access.SqlConne ctionHolder.Ope n(HttpContext context,
    Boolean revertImpersona te) +84
    System.Web.Data Access.SqlConne ctionHelper.Get Connection(Stri ng
    connectionStrin g, Boolean revertImpersona tion) +197
    System.Web.Secu rity.SqlMembers hipProvider.Get PasswordWithFor mat(String
    username, Boolean updateLastLogin ActivityDate, Int32& status, String&
    password, Int32& passwordFormat, String& passwordSalt, Int32&
    failedPasswordA ttemptCount, Int32& failedPasswordA nswerAttemptCou nt,
    Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDat e)
    +1121
    System.Web.Secu rity.SqlMembers hipProvider.Che ckPassword(Stri ng username,
    String password, Boolean updateLastLogin ActivityDate, Boolean
    failIfNotApprov ed, String& salt, Int32& passwordFormat) +105
    System.Web.Secu rity.SqlMembers hipProvider.Che ckPassword(Stri ng username,
    String password, Boolean updateLastLogin ActivityDate, Boolean
    failIfNotApprov ed) +42
    System.Web.Secu rity.SqlMembers hipProvider.Val idateUser(Strin g username,
    String password) +83
    System.Web.UI.W ebControls.Logi n.OnAuthenticat e(AuthenticateE ventArgs e)
    +160
    System.Web.UI.W ebControls.Logi n.AttemptLogin( ) +105
    System.Web.UI.W ebControls.Logi n.OnBubbleEvent (Object source, EventArgs
    e) +99
    System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args)
    +35
    System.Web.UI.W ebControls.Butt on.OnCommand(Co mmandEventArgs e) +115
    System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String
    eventArgument) +163
    >
    System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
    eventArgument) +7
    System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
    sourceControl, String eventArgument) +11
    System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
    System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102
    >
    >
    >
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.507 27.832;
    ASP.NET Version:2.0.507 27.832
    >
    Here's my configuration situation. I'm running .net 2.0 and sql server
    2005. I'm using integrated security in my connection string similar to
    "Data Source=SERVER;I nitial Catalog=DATABAS E;Trusted_Conne ction=True;".
    The applicaiton in IIS is running as a network level user that has
    db_owner access to the database in the connection string. The user is
    impersonated in the web.config using "<identity impersonate="tr ue"/>".
    The rest of the database access on the site works fine using the same
    connection string. I only get the error above when trying to do the
    membership functionality. It almost looks like when I use the classes
    that it drops the annonymous user and goes back to using a machine level
    account.
    >
    Any help would be greatly appreciated.
    >
    Thanks,
    Matt
    >

    Comment

    Working...