Skip to content

SigninManager on Asp.Net 6 Identity returns failure when app is deployed #51

@BaronMatrix

Description

@BaronMatrix

Hi,
I'm having a weird issue and this is the last place to search for an answer. I have created a site for deployment to my ISP. Whenever I try to sign in with users created locally it returns Result.Failed. I'm using the generic Identity scaffold with Personal Data added.

I have deployed another site to the same ISP with the same boiler plate code and it worked fine. I found the error by returning result.ToString() in the else statement in Login.cshtml.cs as the PasswordSighInAsync function only returns a status message and not an error.

else { ModelState.AddModelError(string.Empty, result.ToString()); return Page(); } 

I checked the SigninManager code here and there are three situations when failure is assigned, but it's not clear why logging into the same remote DB with the same ApplicationDbContext succeeds when I run locally in either debug or release.

I also hit the error below when trying to register from the .com web site and it doesn't happen locally. But checking the DB the user is created. Testing also showed that setting RequireConfirmedAccount to false still returns NotAllowed.

Turning off the RequireConfirmed was necessary becuase the GenerateTokenAsync() call would fail

**Error.
An error occurred while processing your request.

Request ID: 00-825112947d1a57ef4eca465146ff6805-747b92bafdb872df-00
Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.**

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions