use correct redirect_uri

This commit is contained in:
B. Petersen
2019-02-18 22:55:12 +01:00
parent 1fa18be37d
commit bb4b72eab1
2 changed files with 16 additions and 2 deletions
+11 -1
View File
@@ -173,7 +173,17 @@
<activity android:name=".RegistrationActivity"
android:launchMode="singleTask"
android:windowSoftInputMode="stateUnchanged"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- this scheme is used as the redirect_url for getOauth2Url()
and should be whitelisted by the supported oauth2 services -->
<data android:scheme="chat.delta" android:path="/${applicationId}/auth" tools:ignore="AppLinkUrlError"/>
</intent-filter>
</activity>
<activity android:name=".LogViewActivity"
android:label="@string/pref_view_log"
@@ -217,7 +217,11 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
String email = emailInput.getText().toString();
if (!TextUtils.isEmpty(email) ) {
String redirectUrl = "https://localhost/delta/auth";
// the redirect-uri is also used as intent-filter in the manifest
// and should be whitelisted by the supported oauth2 services
String redirectUrl = "chat.delta:/"+BuildConfig.APPLICATION_ID+"/auth";
String oauth2url = DcHelper.getContext(this).getOauth2Url(email, redirectUrl);
if (!TextUtils.isEmpty(oauth2url)) {
new AlertDialog.Builder(this)