MicrosoftEdge / enterprise-mode-site-list-portal

Other
52 stars 24 forks source link

Unable to sign in after registering and activating accounts #14

Open PotentEngineer opened 5 years ago

PotentEngineer commented 5 years ago

We are just setting the EMSLP up in our PROD environment and cannot get any user to sign in.

"We couldn't sign you in because your account isn't currently active. Please register or contact your site administrator."

One concern, the servers are in a subdomain of the domain where the users accounts reside.

We did verify the users appear in the dbo.Users table in SQL with the proper email address.

What info can we provide to troubleshoot this issue?

MarkSPowell commented 4 years ago

I believe this is caused when a users samAccountName and first part of email address are not the same thing. CreateNewUser looks at the email address, strips off everything after the @ sign, and sets LoginID to that.

The LogonController, however, looks at User.Identity.Name, which is your Domain\samAccountName. It then strips off the Domain\ part, and looks for that LoginID.

I've submitted a pull request that changes both controllers to use User.Identity.Name instead. This should also allow users with the same name but from domains to log in- which, admittedly, I suspect is unlikely.

PotentEngineer commented 4 years ago

Thank you Mark! That does match our environment, the names do not match up.

MarkSPowell commented 4 years ago

Waiting on approval to release my PR from our internal teams- and then MS will need to accept it.

Thinking I'll tweak it just a bit- if we just alter the Create User function to use the 2nd half of Http.Identity.User (IE, just the samAccountName), it'll maintain backwards compatibility with older versions.

That means that if you want to make stuff work today, open up your database and check the user table- change LogonID from your email address to your login id.

IE, if my email is mark.powell@example.com, but I type mspowell into windows to log in- change it from Mark.Powell to mspowell.

PotentEngineer commented 4 years ago

update users set LoginID = 'jdoe123' where LoginId = 'johndoe'

That worked! We are in! Thanks for the help. Look forward for the updates.

MarkSPowell commented 4 years ago

Great. Does the Settings page work for you? I'm still playing with it, not sure if I made a mistake or it's a similar issue yet.

PotentEngineer commented 4 years ago

No issues here. Settings are loading fine. We haven't configured them yet though.

MarkSPowell commented 4 years ago

Submitted.