-
Notifications
You must be signed in to change notification settings - Fork 36
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
[Bug fix] Use hub app's FRT to get nested app's AT #2379
Conversation
common4j/src/main/com/microsoft/identity/common/java/controllers/BaseController.java
Outdated
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/controllers/BaseController.java
Outdated
Show resolved
Hide resolved
/** | ||
* Renewing AT of nested app. | ||
*/ | ||
protected synchronized void renewAccessTokenForNestedApp(@NonNull final SilentTokenCommandParameters parameters, |
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.
Why in BaseController? would non broker controller need this?
This method by itself has no check around NAA or FOCI, so can be called erroneously.
I think Foci RT request logic can be directly inside a BrokerLocalController private method. Then you can call renewAccessToken()
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.
Agreed. This is not required in any other cases. Moved it to BrokerLocalController.
Closing this PR as this won't be required once Mohit implements the long term fix. He will be working on this in next sprint. |
Problem : In cross cloud requests, we fallback to BrokerLocallController. This is applicable for NAA requests as well.
Let's say the user performs below steps
The above problem is observed in OneAuth and iOS as well. We have checked with eSTS team is they can fix this on their side to let any FRT mint an RT for a nested app and they replied that this is not acceptable by design.
Fix : When a silent request is made from a nested app in cross cloud scenario, it reaches renewAT step (OneAuth only forwards silent calls to broker when AT is expired). I have modified renewAT for nested app to follow below steps
NOTE : There is another bug on eSTS side where if an RT of a hub app is retrieved in a nested app's context and it is an FRT, we are unable to use that FRT for other apps in FOCI family. This PR does not address that issue. We are waiting for eSTS to send a fix for this.
Related broker PR : https://github.com/AzureAD/ad-accounts-for-android/pull/2772
UI tests added in : AzureAD/microsoft-authentication-library-for-android#2075