Open rmnaderdev opened 5 months ago
Hi there @PotatoDotJar!
Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.
We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
Thanks @rmnaderdev for reporting this issue 😊. As I can see there are 2 parts to this issue.
I tried logging in case autoLinkExternalAccount = false, I can see that the error message has been added in the following code BackOfficeController - ExternalSignInAsync :
In the index.cshtml (HTML for Umbraco Login page) has the code to show this errors:
But the truth is that these errors were not displayed. The reason in my opinion is because the Login page was not re-rendered to update externalSignInErrors.
Solution: to solve this problem, I think we can consider adding a new flag like CreateNewUser = true/false inside AutoLinkAndSignInExternalAccount() in BackOfficeSignInManager.cs
Hi @rmnaderdev,
Thanks for reporting this and for the detailed description 💪
A quick FYI: Your OnTicketReceived
shouldn't need the context.Fail("User does not exist")
in order to prevent users from being logged in; returning false
in OnExternalLogin
should be sufficient.
This issue really is a combination of a bug and a feature request, so we'll have to split it eventually.
The missing error message
This is indeed a bug, and I can reproduce this as well in the latest V13. It might also be an issue in V14 - it's tied to the new, AngularJS-less login screen, which was introduced in V13.
I'll have a chat with the team about fixing this.
Not creating auto-linked users
This is a new feature. I like the idea 👍
Time will tell if we can squeeze it into V13 or if it will be a V14+ thing.
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.2.2
Bug summary
Background: In my current project, we are using BO SSO using OpenIdConnect with AzureAD. I want to be able to prevent user login (and account creation) if the user's account is not already in the system (based on email address). If the user is not in the system, a user account should not be added to the Umbraco system.
The bug: The bug I am reporting is that if a user is not allowed into the BO after using the SSO login, they are just sent back to the Umbraco login screen with no further error message or anything. In the OnTicketReceived hook, I am calling
context.Fail("Invalid user")
if the user's email is not found in the system. In theOnExternalLogin
property in the OpenIdConnect options, I am also returning false if the user's email is not found in the system.Specifics
Using
Microsoft.AspNetCore.Authentication.OpenIdConnect
@ v8.0.0BackOfficeExternalLoginProviderOptions file:
ExternalProviderBackOfficeExtension:
Steps to reproduce
Expected result / actual result
When a user is redirected back from Azure SSO, I would expect the Umbraco login page to have some sort of message or indication that the login failed. Perhaps it would show the message passed to the
OnTicketReceived
Func. For example:context.Fail("MY MESSAGE HERE")
would display "MY MESSAGE HERE" somewhere on the login screen.I understand my use-case for user SSO is a bit different than the Doc examples. We want the user accounts to be auto-linked, but only based on our logic. If the SSO user's email is not found in the Umbraco users, deny login. Please let me know if I missed something.