-
Notifications
You must be signed in to change notification settings - Fork 15
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
NLX - Move error reporting from SSO dashboard to NLX #99
Comments
After experimenting a bit, it seems using parameters and templated messages seems the way forward. Thanks for suggesting this, @gene1wood. I'm implementing it in NLX by using the Possible errorsgithubrequiremfaError message for when GitHub is used without MFA. fxarequiremfaError message for when Firefox Accounts is used without MFA. notingroupError message for when user does not have correct group permissions. accesshasexpiredError message for when access has expired. primarynotverifiedError message for when primary identity was not verified. incorrectaccountError message for when wrong account is being used to log in. error_generalGeneral error message.
The info NLX is currently missingName of the RPFor errors: not in group, access has expired, incorrect account. Suggestion: let's pass it using Name of the connectionFor errors: primary not verified, incorrect account Suggestion: let's pass it using Name of user's most secure connectionFor errors: incorrect account (Can we pass this?) If so, let's pass it using
UX questions@m-branson:
Example: and clicking ‘Need to log in with a different account’ would go to the initial page, i.e. this page: |
Would be great to get these in a collected environment (sheet?) where they can be reviewed mutually. Additionally, would it be possible to link to the error screen in a staging environment so it can be visualized if necessary? (if there is a way to do this already without running through the entire flow, please tell me) My thinking here: make these touchpoints more visible to the entire team so we can mutually understand their user impact & feedback on them intentionally.
100% yes, for that use case/screen specifically. That said, there may be a more suitable CTA(s) based on the error. This is an additional reason for the sheet mentioned above, how might we better assess & curate the content needed for each error? |
Great idea! I've created a spreadsheet (only accessible to team members), it has all the error messages and a link to an example screen that uses the new error functionality that is available in NLX Dev.
Cool. I've defaulted to the same button for all now, and also the same title. They are easy to customise (but we don't have to… consistency is also good). |
After discussion with @gdestuynder we agreed I will parse the JWT sent by the rule, rather than adding the variables as query parameters. |
I've spent some time on decoding JWT client-side (easy) and verifying it client-side (harder). I have some further questions. (Summarising this for myself to make sure I understand it correctly, please correct if wrong) If we're using a JWT, we need to decode it (base64 to plain text) and verify its signature. Anyone can decode it, so just like with passing the values in as plain text, they would be public. So hiding from public is not why we want the JWT (I made incorrect assumption there). The reason we want JWT is that we can add a signature to the JWT, so that we can make ensure the information in it comes from where we think it comes from, in other words we verify authenticity. Should we verify?I'd like to discuss possible attacks further. The content we take from the parameters is plain text and inserted as such (with There are probably risks I'm not thinking of, but I thought it'd be good to ask this again. If we verify, what's the fallback?I've looked at various libraries that can do verifying for us, but most of them also do signing and various other cryptographic operations. Hence they are quite big, Auth0's one, which seems like the most solid option, adds 300kb to the JS bundle, that's just over 300% increase. There is also a web standard, the Web Crypto API, which I'd prefer to use directly, it has less browser support (about 80% of all users; this may be more for our user base as we have more than average Firefox users). If we go with verification, my proposal is:
The alterative would be that we show nothing if we are unable to verify, but to me that feels a bit like throwing out the baby with the bathwater. |
I'm assuming you mean pass these as additional arguments inside the JWT ya? (Not query parameters) The client name (RP name) is in the jwt
The connection name is also in the jwt however you may need to translate it into something human readable
I believe this is provided
Yes, we can pass these unencrypted but signed as long as we verify the signature before acting on them.
We could make a PR for the Auth0 rule change and deploy it to auth0 dev but not prod. Oh, looks like you talked to kang and got most of this worked out
Unless we can always guarantee that no data passed in the jwt will be returned on the screen we must verify. If that's not the case then there's no reason to use a jwt. I can easily see if we were to not verify, that in the future data would be added that is injected into the page, we'd forget that the jwt wasn't being verified, and then we'd have a security vulnerability.
Why not use a cdn based library that clients likely already have cached? Like this https://cdnjs.com/libraries/jsrsasign
If we're passing any data in the jwt that is then injected into the NLX page, this isn't safe, even for non-supporting browsers. If we're not then there's no reason to be using a jwt
I don't think we should use a message integrity method that isn't supported on all our user's browsers (especially since we don't need to, jwt is supported on all browsers). If we don't want to use jwt we can spin our own message integrity solution but to me jwt seems like that simplest solution (which is why we used it for sso dashboard) |
after discussing this morning, if we do not use a signature, then we have to drop |
I'm not clear on the downsides of verifying the jwt using a traditional library fetched from a cdn |
Downsides of verifying (which, to be clear, I agree would be more elegant):
Downsides of using a library:
Downsides of loading via a CDN:
My proposal, looking at time, needs and possible risks to user experience and stability, would be to either keep this simple and show client names and connection names as we receive them, unverified, or given the downsides I've identified above, we could still leave error messaging in SSO Dashboard, where we can do what we want on the server, and use libraries we want as they won’t make the user wait / spend money on their data bundle. |
Just to make sure this part is clear: this is incorrect if a redirect_uri is used. You can redirect a user to any website and it looks like it's been vetted by Mozilla at this point. Great phishing opportunity and very realistic. Our VA process would find this in a minute for example, which is my benchmark for "how likely would this happen". |
Yes, absolutely. We would only insert things with Let's discuss in Tech Alignment if:
|
As discussed in Tech Alignment, this is too hard to do in the front-end because of large libraries and inevitable browser support issues (it will always not work for some users). Doing it in a back-end would not have these two problems, as libraries in the back-end are ‘free’ from a perf perspective and we only need support on the OS the back-end runs on, not all of our user's browsers. We will defer working on this until we have a back-end for NLX, so that it can do our JWT verification for us and we can have verified error messages as we currently have them. |
Background
The associated Auth0 rule issue to track the change on that side is mozilla-iam/auth0-deploy#186
Currently, when an error message needs to be conveyed to the user due to an Auth0 rule, that message is sent in a jwt to the sso dashboard to be rendered.
Problem
The navigation flow of sending a user from NLX to the sso dashboard and having to use the back button to get back to the RP isn't ideal. This is currently tracked in SSO dashboard mozilla-iam/sso-dashboard#205 and mozilla/parsys#253 as "improve error page wayfinding"
It's confusing to the user to go to an RP, try to login and then be sent to a site that they weren't on before (sso dashboard) and potentially haven't gone to before to see an error message about another site (their RP or the NLX)
Solution
Define a query parameter (or POST data expectation), for example
display_error
. When NLX gets a request with this parameter, it fetches the content and displays the error message in the NLX.How to make this safe
You could expect the payload of this error message to be a JWT as is created now (example of how it's currently done, so that NLX could verify the signature of the payload before displaying it.
Alternatively, you could define templatized error messages in NLX and inject in the variables needed to display the message.
The text was updated successfully, but these errors were encountered: