-
Notifications
You must be signed in to change notification settings - Fork 36
Add a common implementation for the BrokerRestrictionsManager, Fixes AB#3181005 #2604
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
base: dev
Are you sure you want to change the base?
Conversation
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
…zureAD/microsoft-authentication-library-common-for-android into pedroro/moveRestrictionManager
common/src/main/java/com/microsoft/identity/common/internal/util/RestrictionsManagerHelper.kt
Outdated
Show resolved
Hide resolved
/** | ||
* Helper class to read the app restrictions manager of the current broker app or another broker app. | ||
*/ | ||
class RestrictionsManagerHelper( |
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.
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.
If we are in a non-broker flow, we do not call RestrictionsManagerHelper for this QR PIN scenario, checking the Activity type that contains the fragment.
However, in a hypothetical scenario where RestrictionsManagerHelper is used in a non-broker flow:
- Requesting data from a broker app: will make an IPC call to the broker app, read the Restrictions manager from there, and return the result.
- Requesting data from the current app: will read the Restrictions manager of the app, which will likely be null.
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.
I raised this because I feel like this is broker only component is being put in common and can potentially run in non-brokered flow. It would be better if could inject an object in common layer (or WebViewAuthorizationFragment in this case) to customize behavior for broker vs other. It's general problem that is seen on other cases as well e.g. nonce redirect handling, flighting
I guess, it might be too much work if you do that in this PR?
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.
Q: For what would be logic for non-broker flow?
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.
for non-broker flow we do not check the restriction manager, and we just grant the camera permission if we have it.
But even if the component were called in a non-broker flow it will keep working as I change it to only read RestrictionsManager from broker apps
Context
Currently, for QR + PIN authentication, users are prompted for camera permission every time the camera is used, even if OS-level permissions are granted. This is a CELA requirement to ensure user consent. However, a new feature request aims to suppress this camera permission prompt if an admin enables a specific flag in the restriction manager of the authenticator app.
Changes
Upcoming PRs will leverage this flag to implement functionality that suppresses the camera permission prompt when enabled by the admin.
Related PR: https://github.com/AzureAD/ad-accounts-for-android/pull/3066
AB#3181005