2017-03-15 24 views
0

我們擁有一個遵循OAuth2協議1的Auth服務。網址如下:使用我們自己的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

我解決它:

<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. 有將其添加到manifest.xml中
  2. 應用模式上的訪問:// URL路徑。