-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canonicalized email is returned as the 'sub' instead of the original email. #165
Canonicalized email is returned as the 'sub' instead of the original email. #165
Comments
This is something of a discussion we're having right now. The original intention was that your email provider could tell Portier and the site you're logging into what the canonical version of the email address is. Now GMail doesn't do Portier just yet, so we do it for them, and normalize by removing dots. Rolling this out, we discovered we broke a bunch of accounts, because people previously had accounts for So we're considering what to do here. I was personally thinking we should revert the change, and stick to our own, documented normalization only. That's basically lowercasing the email address (accounting for non-latin and international domain names.) I think we also have to figure out how to deal with this kind of breakage. Maybe we need to version the API? |
Maybe we need to provide everything we have there:
We already return multiple emails in Line 223 in 2f6fd0b
|
I'm gonna continue here the conversation regarding identity handle I had with @onli in [https://github.com/portier/portier.github.io/issues/13#issuecomment-420946785](issue #13), since this is a better fitting issue.
In my opinion it all comes down to why the email resolution was done in the first place? The design docs specifically mentions discovering a different email than the one entered by the user, and re-validating that one if it is different. What was the reasoning behind this? Was it to make sure to find the "canonical" email of the user, which you expect to be stable in case the user ends up entering another email that ties to the same account? I think that's where things get tricky. You have no assurance in OpenID Connect that the email claim of the user will not change over time. What happens in that case? Right now you'd just end up login in the user as a different identity. IMO, that's one of the reason why using the email as the account handle can be problematic. Which brings me to the other part of the discussion in the other issue:
Here I wholly disagree. The concept of identity is tied to the user (or other logical entity). The authority / identity provider is in charge of verifying the identity of the the user, by whatever means it sees fit (2FA, password, other out-of-band verification). It then makes and assertion to the Relying Party (Portier broker in this case) that the user coming in is known as a certain handle. That handle (subject in the authentication) uniquely identifies that user. This is where the authentication should stop, the broker or relying party shouldn't have to perform any further authentication of the user's identity. If the user/entity behind the identifier changes, so should the handle. Changing ownership of the domain would cause a new identity provider to be used, and thus a new subject. In Portier you end up putting back the identifier/email as a handle, and basically hide this change. To be honest, a system based on opaque handles is probably incompatible with what Portier is trying to achieve, especially when mixing it with the built-in SMTP authentication fallback. Adding an identity provider to a domain that previously would authenticate through email verification, is basically the same as changing ownership of the domain, and there is no way to prove continued ownership of the identity. But if you say that Portier is a way to easily verify ownership of an email identifier by a user, then not using opaque handles is fine. It's all about expectations. I think no one should consider Portier as a full identity provider, nor an identity broker. It can only make assertions about the ownership of an email address. In which case, removing the canonization of the email makes total sense. |
That was the idea, yes. It was also a bad idea for when a users' provider 'upgrades' from SMTP fallback to implementing Portier IdP. Suddenly the IdP may start doing normalisation and break existing users' logins. Portier specifies both sides (RP -> Broker & Broker -> IdP) in a single flow, so ideally the solution we come up with solves the problem for both. So I think we should simply enforce servers (as both Broker & IdP) do what @onli suggested above:
The intention of OpenID Connect compliance was to ease adoption through libraries, not to guarantee any sort of compliance with existing providers. Portier tries to make stronger guarantees than OpenID Connect. But I don't think we can make the claim that any current OpenID Connect provider will just work.
I think that's correct. Portier just wants to be better email verification. I think a lot of currently in-the-wild services break the same way Portier does when domain/email ownership changes, so I personally at least never tried to tackle that issue with Portier. |
This is still a pain point for us, so I was looking at this again. Even though I'm kind of waiting on Rust async/await to pick up Portier work again, I'm willing to work on this short term, because it's been incredibly annoying. One of the things about portier-broker/src/bridges/oidc.rs Lines 279 to 281 in 46971a2
So I'm tempted to completely drop it. Doubly so because I believe it'll have very limited usefulness in practice. The other issue I have is how we should communicate this transition. Even without the above, I'm going to try this on a branch and schedule a deploy/transition of our private broker at $work. |
We've deployed this at $work, so will see if there are any issues. I believe there will be no impact for us, but that's because we only have private apps, with no registration. Some points from our analysis:
|
Sounds like this is definitely an improvement. I wasn't aware of the Node & PHP clients breaking. We haven't had many reports about people using portier in the wild, which makes me assume that pipes.digital is one of its biggest users. And that site is still small enough that I'm comfortable handling the support requests, or rather maybe fixing pooential issues beforehand. |
Php client v0.2.1 is unable to auth "[email protected]" and fails with "fail: Invalid or expired nonce". |
@stephank did you see this? |
I tried to log in as
<first>.<last>@gmail.com
, but was instead authenticated as<first><last>@gmail.com
.I can't tell from @callahad's comment here if the "identical string" returned should be the original or the canonicalized version.
In my head, I can argue for both approaches. Just thought I'd ask and see if this is indeed intentional.
Thanks.
The text was updated successfully, but these errors were encountered: