-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allowed urls do not include return_to #259
Allowed urls do not include return_to #259
Comments
I'm able to reproduce the issue deploying kratos rev 471 and login ui rev 117.
|
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-1044.
|
It is only reproducible with the provided steps but not when following a standard process for password reset.
|
In this specific case, when user starts the recovery flow (in the "enter email to reset password" step), it doesn't ask for a one-time code sent by email because the user has completed authentication with password and thus already has a session with aal1.
This call fails because the
I found that this nested return url is calculated by kratos sdk here (log message from a localhost setup):
I think the issue is that kratos sends the internal service dns in relation data and login ui uses it as Note: Kratos public API is normally called during login flow, for example when user needs to complete 2fa (e.g. |
https://github.com/canonical/kratos-operator/blob/main/src%2Fcharm.py#L538-L545 I think something is lost in the UI endpoint relation as I cannot explain why the login URL is fine but the others are not |
After thinking about this a little further, I realize that I didn’t really understand the issue at first. This may seem like an edge case, but it will become a more frequent case if (when) we introduce a side bar (or some kind of navigation menu). I think that the problem is that we have mixed up the recovery and the settings flows. Currently to reset a user’s password what happens is:
This bug happens when the user already has an active session, in that case what happens is:
The difference between these 2 cases is that on the 1st case the user logs in using the recovery via email method and on the second case the user logs in using user name and password. It appears that our intention was to support only the first case. IMHO an IdP should support both of these flows, one is for resetting the password (aka The proper solution would be to untangle the 2 flows. We need to:
But the question is, from a UX/flow perspective what is our intention here? (cc @natalian98 @lukasSerelis) |
My assumption was that if a user starts a recovery flow but is already logged in, he intents to reset the password, hence the redirection. If a user with a valid session wants to reset pwd, going to |
If I deploy the bundle, create an admin account via juju CLI, setup the authenticator and try login via Hydra:
![image](https://private-user-images.githubusercontent.com/19745916/365157946-b92ba1c7-d9fe-4498-9ad0-00757ea9ba03.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjAxMzgsIm5iZiI6MTczOTMxOTgzOCwicGF0aCI6Ii8xOTc0NTkxNi8zNjUxNTc5NDYtYjkyYmExYzctZDlmZS00NDk4LTlhZDAtMDA3NTdlYTliYTAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMjM1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxOGVkMzRhM2M1ZDkyOTZkZGNmZjMwMmE3YjhlZWFmZTFlODVjYTUxMzY2M2U3MmY4YTU2NTc5ZTIyY2ZjYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Wf1Ptg4X-XTO84jD67CptXgg_AuH_hToQE81EVYkmtI)
I will end up in the totp page:
![image](https://private-user-images.githubusercontent.com/19745916/365158089-9be05476-db90-421c-9744-03e5afd86698.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjAxMzgsIm5iZiI6MTczOTMxOTgzOCwicGF0aCI6Ii8xOTc0NTkxNi8zNjUxNTgwODktOWJlMDU0NzYtZGI5MC00MjFjLTk3NDQtMDNlNWFmZDg2Njk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMjM1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBlZDFiMzRmOGQyMjJhYmZhNGFmZmFhMzhiN2Q1N2QzYjg0MDc5NjFlYTBlODMyMGFmZWZkYzkwYjAzNGFlMDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qgr2EmkfJRzuBBYv_hpsfe_5svgOjNli-KuoLSPBEj0)
Now if I go back (without entering the otp), I will be asked only for my password (username is cached):
![image](https://private-user-images.githubusercontent.com/19745916/365158264-edcb8eac-81c6-4f5b-8c53-35fbbd324b71.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjAxMzgsIm5iZiI6MTczOTMxOTgzOCwicGF0aCI6Ii8xOTc0NTkxNi8zNjUxNTgyNjQtZWRjYjhlYWMtODFjNi00ZjViLThjNTMtMzVmYmJkMzI0YjcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMjM1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQyN2NkOWJiMDc5MTg3N2Q3ODUxY2E1MjE1MzA3ZWMyOTg2OTdhZmRjMzUyY2Y1NDhlMWVhNjExODFjYmYyYjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4N13w0pQoAmsYeinm8ikHwTNvPiDc37_mB0p-lNH0uM)
If I now try to reset my password, I will be asked to input my email:
![image](https://private-user-images.githubusercontent.com/19745916/365158420-ea5c9cfb-1a4d-45a3-aa65-3118f5ffc2eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjAxMzgsIm5iZiI6MTczOTMxOTgzOCwicGF0aCI6Ii8xOTc0NTkxNi8zNjUxNTg0MjAtZWE1YzljZmItMWE0ZC00NWEzLWFhNjUtMzExOGY1ZmZjMmViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMjM1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzNjc1N2NmMmJjMGQ3NWQ1Mzg3ZjkwNzU1YzBkYjVlZjQzYTgzN2QzODk0ZjMyODhjMzJhZjMyZDdhOTgxMjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.5A6jlXpGkjGh16Gny7iSGc3yJbxVIWvvCU1N4Yx1zDg)
But then I will be redirected to an error page:
![image](https://private-user-images.githubusercontent.com/19745916/365158500-821aef5e-6238-4c73-a13a-f204033f799a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjAxMzgsIm5iZiI6MTczOTMxOTgzOCwicGF0aCI6Ii8xOTc0NTkxNi8zNjUxNTg1MDAtODIxYWVmNWUtNjIzOC00YzczLWExM2EtZjIwNDAzM2Y3OTlhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAwMjM1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI5OWZlZmNhZjEwZWY2NWE5YTAxMDYwNDYxYzY1MzU3NjIzMDgyZjY5N2Q1NjJjMDM3NzAyYmI5ZjE3NDJmOWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fi7PiBzMSlxPdijVHUzGC9lSN0zg_IZIBRn4aAyGlDI)
Originally posted by @nsklikas in canonical/iam-bundle#273 (comment)
The text was updated successfully, but these errors were encountered: