-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support a new API Path for Account Transfer V2 in Broker #2375
base: dev
Are you sure you want to change the base?
Conversation
…/ClientException.java Co-authored-by: Shahzaib <37125644+shahzaibj@users.noreply.github.com>
@@ -1599,6 +1600,12 @@ public String getMsalVersion(){ | |||
*/ | |||
public static final String MSAL_ACQUIRE_TOKEN_INTERACTIVE_PATH = "/acquireTokenInteractive"; | |||
|
|||
/** | |||
* URI Path constant for MSAL-to-Broker acquireTokenInteractive (for ATv2) request using ContentProvider. | |||
* TODO: Not really sure how this works, this seems right |
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.
Ping
...n/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java
Outdated
Show resolved
Hide resolved
common/src/main/aidl/com/microsoft/identity/client/IMicrosoftAuthService.aidl
Outdated
Show resolved
Hide resolved
.../main/com/microsoft/identity/common/java/commands/parameters/ATv2TokenCommandParameters.java
Outdated
Show resolved
Hide resolved
git commit -m ":wq Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentication-library-common-for-android into fadi/ATv2-API
...n/src/main/java/com/microsoft/identity/common/internal/controllers/BrokerMsalController.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java
Show resolved
Hide resolved
...n/src/main/java/com/microsoft/identity/common/internal/request/MsalBrokerRequestAdapter.java
Outdated
Show resolved
Hide resolved
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.
Approved with suggestions
…tion-library-common-for-android into fadi/ATv2-API t status
common4j/src/main/com/microsoft/identity/common/java/controllers/BaseController.java
Outdated
Show resolved
Hide resolved
@@ -38,6 +38,8 @@ interface IMicrosoftAuthService { | |||
|
|||
Intent getIntentForInteractiveRequest(); | |||
|
|||
Intent getIntentForAccountTransferInteractiveRequest(); |
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.
add it at the bottom.
there might be some weird side effects if the order of aidl on broker and MSAL/OneAuth side mismatches.
final Intent accountTransferIntent = microsoftAuthService.getIntentForAccountTransferInteractiveRequest(); | ||
final Bundle accountTransferBundle = accountTransferIntent.getExtras(); | ||
|
||
//older brokers (pre-ContentProvider) are ONLY sending these values in the intent itself. |
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.
this msg could be confusing - since this operation is just added (it's not pre-ContentProvider)
you actually can just expose
GetBundleForAccountTransferInteractiveRequestMsalBrokerOperation
on the Broker side, and return the resulted bundle as is.
The code will be cleaner on the Broker side, and you wouldn't need to do extra conversion here.
@Override | ||
public void performPrerequisites(final @NonNull IIpcStrategy strategy) throws BaseException { | ||
verifyTokenParametersAreSupported(parameters); | ||
negotiatedBrokerProtocolVersion = hello(strategy, parameters.getRequiredBrokerProtocolVersion()); |
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 the negotiatedBrokerProtocolVersion is lower than the new version you just added, it means the broker does NOT support this operation.
In that case, you might want to fail the request early. (no need to make the request to the broker because it'll just throw "not supported" back)
In this PR, i'm adding a new API Path for Account Transfer V2 rather than adding the functionality through Account Chooser activity and Acquire Token. This will make it easier to track the code path for ATv2.
Changes:
acquireTokenForAccountTransfer
inBrokerMsalController
, along with metho to get intent for ATv2. This method is defined inBaseController
, although it throws an exception inBaseController
, and is only implemented inBrokerMsalController
AccountTransferTokenCommandParameters
to store transfer tokenAuthenticationConstants
to support new APIBrokerRequest
formAccountTransferToken
Broker PR to support these changes: https://github.com/AzureAD/ad-accounts-for-android/pull/2768
Consumers check (expecting broker to fail): https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1298934&view=results