Adds support for exchanging the authorization code returned from the /authorize endpoint for a token using the /token endpoint
Completion Handling
I "intercepted" the completion handler passed into the execute method and exchange the token there if needed. I manually verified using the memory debugger that instances were not retained, but please double check me.
Request -> NetworkRequest
There was a naming conflict between UberAuth.Request and UberRides.Request, and I couldn't specify the namespace because I named a class (UberAuth) the same as the framework name 😅. So this was breaking mocks.
I renamed Request to NetworkRequest to fix this. If UberRides is removed in the future we could change the name back.
TokenRequest
This should be similar to the other requests, ParRequest or AuthorizeRequest. It makes a request to the token endpoint and decodes a Token response conforming to the OAuth standard.
Testing
Unit Tests
Unit tests added for new auth provider logic.
Manual Testing
Update clientID 9QZcD_Ki6NbhGCrVXSUHCxfevm-C9Khj in the sample app's Info.plist
Toggle the Exchange Auth Code for Token to on
Login and verify a token (and no auth code) is sent in the response
Description
Adds support for exchanging the authorization code returned from the /authorize endpoint for a token using the /token endpoint
Completion Handling
I "intercepted" the completion handler passed into the execute method and exchange the token there if needed. I manually verified using the memory debugger that instances were not retained, but please double check me.
Request -> NetworkRequest
There was a naming conflict between UberAuth.Request and UberRides.Request, and I couldn't specify the namespace because I named a class (UberAuth) the same as the framework name 😅. So this was breaking mocks. I renamed Request to NetworkRequest to fix this. If UberRides is removed in the future we could change the name back.
TokenRequest
This should be similar to the other requests, ParRequest or AuthorizeRequest. It makes a request to the token endpoint and decodes a Token response conforming to the OAuth standard.
Testing
Unit Tests
Unit tests added for new auth provider logic.
Manual Testing
9QZcD_Ki6NbhGCrVXSUHCxfevm-C9Khj
in the sample app's Info.plistExchange Auth Code for Token
to onVideo