#Google Auth Android Bad Request

8 messages · Page 1 of 1 (latest)

lusty mulch
#

i am trying to implement google auth in andorid but it just keep giving me general_bad_request

// Android Manifest

        <activity
            android:name="io.appwrite.views.CallbackActivity"
            android:exported="true">
            <intent-filter android:label="android_web_auth" android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="appwrite-callback-myprojectcode" />

            </intent-filter>
        </activity>

// Conpanion Object

    object Config {
        // Change below values to match your Appwrite project
        const val HOST = "cloud.appwrite.io"
        const val PROJECT = "--my--project--code"

        const val TAG = "TrashActivity"

        // DO NOT mutate below values
        const val ENDPOINT = "https://$HOST/v1"
        const val CALLBACK = "appwrite-callback-$PROJECT"
    }

// Implementation

        val client = Client(applicationContext)
            .setEndpoint(Config.ENDPOINT)
            .setProject(Config.PROJECT)
            .setSelfSigned(true)

        val account = Account(client)
        binding.loginBtn.setOnClickListener {
            GlobalScope.launch {
                try {
                    account.createOAuth2Session(
                        activity = this@TrashActivity,
                        provider = OAuthProvider.GOOGLE,
                        success = "${Config.CALLBACK}://${Config.HOST}/auth/oauth2/success",
                        failure = "${Config.CALLBACK}://${Config.HOST}/auth/oauth2/failure"
                    )
                } catch (e: Exception) {
                    Log.d(TAG, "Exception: $e")
                }
            }
        }
ember basin
lusty mulch
#

how do i check the response @ember basin cuz its inside the appwrite sdk right so i dont know how to check its response

lusty mulch
#

ok i will you know @ember basin

visual thunder
wary leaf
#

Same here with flutter

#

appwrite 14.0.0