Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

iOS Broker Null Ref in TokenResponse (Key missing) #1606

Closed
jennyf19 opened this issue May 29, 2019 · 1 comment · Fixed by #1614
Closed

iOS Broker Null Ref in TokenResponse (Key missing) #1606

jennyf19 opened this issue May 29, 2019 · 1 comment · Fixed by #1614

Comments

@jennyf19
Copy link
Contributor

Which Version of ADAL are you using ?
5.0.5

Which platform has the issue?
Xamarin iOS + iOS Broker v2

Repro

  • Register an app in the portal

  • Register this redirectUri: adaliosapp://com.yourcompany.xformsapp

  • Do not include MS Graph as required permissions

  • Include the client_id from the app in the Xamarin project (in AppConstants.cs)

  • Rebuild

  • When the app loads, select the "broker" option under client_id

  • Hit "Acquire Token with Broker"

Expected behavior
ADAL will return a nice error message that the app is misconfigured based on the broker response (does not have permission to MS Graph)

Actual behavior
A null ref is thrown in the token response because the broker response dictionary does not contain the key "error" in this case.

Possible Solution
If the key "error" is not present, use "error_domain" instead, which is a required value coming back from iOS broker. Only iOS broker is using this code, so Android broker response is not valid in this scenario.

I don't know if we ever tested this particular scenario, and is not related to iOS broker v2.

@jennyf19 jennyf19 self-assigned this May 29, 2019
@jmprieur jmprieur added this to the 5.0.6 milestone Jun 6, 2019
This was referenced Jun 7, 2019
@jennyf19 jennyf19 added the Fixed label Jun 11, 2019
@jennyf19
Copy link
Contributor Author

Fixed in adal 5.1.0 release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.