androidcallbackurl

OAuth2 CallBack URL


I am doing OAuth2 authentication on Android. I get a "java.util.NoSuchElementException" error when trying to use the authorization code further down the line. After testing it seems that the call is correct, but I get nothing back..

My callback uri is set in the Settings Page, the Activity and the Manifest (see below). According to me it is not working because I am not in production.

One advice I received is to "set up your application as webapp", but it is not clear to me what steps I exactly have to take. Any advice?

Intent Filter set in the Manifest File.

<intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <data android:scheme="https://fibi22cj69"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/> </intent-
    filter>

Solution

  • Try like that:

    <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:host="yourcallback.com"
            android:scheme="oauth" />
    </intent-filter>
    

    And in the client, set the callback url to oauth://yourcallback.com