-
Notifications
You must be signed in to change notification settings - Fork 43
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
Create an approved site when using device code flow #821
base: develop
Are you sure you want to change the base?
Conversation
256a43a
to
9ade9b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix only test
@@ -257,6 +261,10 @@ public String approveDevice(@RequestParam("user_code") String userCode, | |||
|
|||
model.put("approved", true); | |||
|
|||
Date timeout = null; | |||
approvedSiteService.createApprovedSite(client.getClientId(), auth.getName(), timeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is the case where there is a scope policy. Since it is evaluated after this step, in the approved sites we will see also the filtered scope - and in fact we see it on the consent page and actually approve it, even though it is then removed from the scope policy filter in the access token.
In general, this mitre code needs to be improved later, but as a start I think it might be fine like this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is the case where there is a scope policy. Since it is evaluated after this step, in the approved sites we will see also the filtered scope - and in fact we see it on the consent page and actually approve it, even though it is then removed from the scope policy filter in the access token. In general, this mitre code needs to be improved later, but as a start I think it might be fine like this!
Scope policy filter added before the device consent page!
since it was always prompting to the consent page, even when already approved. Looks like the check if "authorizationRequest.isApproved()" is necessary
for both authorization and device code flows
Quality Gate passedIssues Measures |
From Gabriel Zachmann: the client should only be linked to the user account if it currently is not linked to any user or at least not for public clients. |
...ervice/src/test/java/it/infn/mw/iam/test/oauth/scope/pdp/ScopePolicyFilteringDeviceCode.java
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
The device code flow did not imply the creation of an approved site when the user give the consent to the client, as the authorization code flow does.
This PR adds an approved site using the same logic as the authorization code flow. Moreover, the scope policy filter has been added here for both the authorization code flow and device code flow.
This required to move (and cleanup) MitreID classes related to the device code flow into IAM.