Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 973d2eb3 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #8406 from wmontwe/change-gmail-oauth-setup

Change Gmail OAuth setup
parents 5be4e9a3 8bf08e0a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -241,6 +241,10 @@ dependencies {
    implementation(projects.feature.onboarding.migration.thunderbird)
    implementation(projects.feature.migration.launcher.thunderbird)

    // TODO remove once OAuth ids have been moved from TBD to TBA
    "betaImplementation"(libs.appauth)
    releaseImplementation(libs.appauth)

    testImplementation(libs.robolectric)

    // Required for DependencyInjectionTest to be able to resolve OpenPgpApiManager
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!-- TODO remove once OAuth ids have been moved from TBD to TBA -->
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto"
    >

    <application>
        <activity
            android:name="net.openid.appauth.RedirectUriReceiverActivity"
            android:exported="true"
            >

            <!-- The library's default intent filter with `appAuthRedirectScheme` replaced by `applicationId` -->
            <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="${applicationId}" />
                <data android:scheme="${applicationId}.desktop" />
            </intent-filter>

            <!-- Microsoft uses a special redirect URI format for Android apps -->
            <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="${applicationId}"
                    android:scheme="msauth"
                    />
            </intent-filter>
        </activity>

    </application>
</manifest>
+3 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ class TbOAuthConfigurationFactory : OAuthConfigurationFactory {
        )
    }

    // TODO: Update clientId and redirectUri once new client ID is available
    private fun createGmailConfiguration(): Pair<List<String>, OAuthConfiguration> {
        return listOf(
            "imap.gmail.com",
@@ -49,11 +50,11 @@ class TbOAuthConfigurationFactory : OAuthConfigurationFactory {
            "smtp.gmail.com",
            "smtp.googlemail.com",
        ) to OAuthConfiguration(
            clientId = "406964657835-c88sdh5fpqjhavlje1bs9ac9tf8qv5c2.apps.googleusercontent.com",
            clientId = "406964657835-808044gjdn5vac6dsn99jtka3v8igtle.apps.googleusercontent.com",
            scopes = listOf("https://mail.google.com/"),
            authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth",
            tokenEndpoint = "https://oauth2.googleapis.com/token",
            redirectUri = "${BuildConfig.APPLICATION_ID}:/oauth2redirect",
            redirectUri = "${BuildConfig.APPLICATION_ID}.desktop:/oauth2redirect",
        )
    }

+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class TbOAuthConfigurationFactory : OAuthConfigurationFactory {
            "smtp.gmail.com",
            "smtp.googlemail.com",
        ) to OAuthConfiguration(
            clientId = "406964657835-2bpeeeb9mqlpg0mca8digjdv40m5ja8e.apps.googleusercontent.com",
            clientId = "560629489500-hbru1fssmec60eoa22b8k8l5tbmj0sc1.apps.googleusercontent.com",
            scopes = listOf("https://mail.google.com/"),
            authorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth",
            tokenEndpoint = "https://oauth2.googleapis.com/token",
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!-- TODO remove once OAuth ids have been moved from TBD to TBA -->
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:installLocation="auto"
    >

    <application>
        <activity
            android:name="net.openid.appauth.RedirectUriReceiverActivity"
            android:exported="true"
            >

            <!-- The library's default intent filter with `appAuthRedirectScheme` replaced by `applicationId` -->
            <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="${applicationId}" />
                <data android:scheme="${applicationId}.desktop" />
            </intent-filter>

            <!-- Microsoft uses a special redirect URI format for Android apps -->
            <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="${applicationId}"
                    android:scheme="msauth"
                    />
            </intent-filter>
        </activity>

    </application>
</manifest>
Loading