Combining a few minor fixes for bugs found in UberAuth. Details below.
Changes
Scopes
Scopes were not being sent in the Authorize request, only the default scope was being used in all cases. This PR adds logic to inject the scopes passed in the AuthContext into the authorize request and on to the backend.
Application Launcher
There were certain scenarios where the ApplicationLauncher, a protocol representing UIApplication's openURL, could be called from a background thread. This wraps the only openURL call to ensure it is made from the main thread.
To support this change in testing, a closure can now be passed in to AuthorizationCodeAuthProvider allowing us to specify the AuthorizationSession to be used when launching in app auth.
TokenRequest body
We were incorrectly setting the form url encoded body for the TokenRequest as the url parameters, and it was somehow still working. This PR fixes this by setting the values in the httpBody instead.
Description
Combining a few minor fixes for bugs found in UberAuth. Details below.
Changes
Scopes
Scopes were not being sent in the Authorize request, only the default scope was being used in all cases. This PR adds logic to inject the scopes passed in the AuthContext into the authorize request and on to the backend.
Application Launcher
There were certain scenarios where the ApplicationLauncher, a protocol representing UIApplication's openURL, could be called from a background thread. This wraps the only openURL call to ensure it is made from the main thread. To support this change in testing, a closure can now be passed in to AuthorizationCodeAuthProvider allowing us to specify the AuthorizationSession to be used when launching in app auth.
TokenRequest body
We were incorrectly setting the form url encoded body for the TokenRequest as the url parameters, and it was somehow still working. This PR fixes this by setting the values in the httpBody instead.