From my experience, I've found that there are very little libraries that actually support retrieving the authorization code in a clean way.
On most mobile platform you can "listen" to redirection URLS (being http or some custom scheme)
For example on Android one can easily create an activity to retrieve an access token (based on an authorization code it receives via the redirection URL.
<activity android:name=".OAuthAccessTokenActivity" android:launchMode="singleTask">>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="localhost" />
</intent-filter>
</activity>
In this case
http://localhost
On mobile platforms like Android this seems like the logical thing to do.
The same can be done on iOS, but the Google OAuth library for iOS uses the page title approach if I remember correctly.
Technically there is no difference between the 2 flows. The only difference is the syntax of the redirection URL, resulting in a different location of the authorization code.
From a security point of view, the authorization code alone is worthless without the OAuth2 client secret.
Having the user enter an authorization code is something that I'm not used to seeing in Oauth2 flows but it is possible. If doubt that it will add anything security-wise. IMHO it will only frustrate the user.
That doesn't mean that there are different ways of retrieving and processing an authorization code (Automatic capturing of the code through redirects with localhost or custom URI schemes, or manual delivery)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…