2017-03-15 13 views
0

私たちはOAuth2プロトコルに従ってAuthserviceを持っています。 URLは次のとおりです。独自のAuthserviceでネイティブOAuth2認証に対応します

https://auth.domaon.com/web/login?client_id=client&login_redirect_uri=%2Fweb%2Fauthorize&redirect_uri=????????&response_type=code&state=somestate 

モバイルアプリケーションでユーザーにログインするにはどうすればよいですか?

私はそれをリンクしようとしました。

openAuth() { 
    Linking.openURL('URL above'); 
} 
componentDidMount() { 
    Linking.addEventListener('url', this._handleURL); 
} 
_handleURL(event) { 
    console.log(event.url); 
    console.log(event.url.split('#')[1].split('=')[1].split('&')[0]); 
} 

自分のアプリケーションにリダイレクトするためにリダイレクトURLに何を追加する必要があるのか​​分かりません。

答えて

0

私はそれを解決:// URLパス:

<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="schema" 
    android:host="url" /> 
</intent-filter> 
  1. は、スキーマ上でアクセス
  2. アプリケーションをmanifest.xmlにするためにそれを追加する必要があります。
関連する問題