简体   繁体   中英

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM