Skip to content

Supabase auth Google OAuth2 flow 403 disallowed_useragent in browser responsive emulation mode #317

@AmiralBl3ndic

Description

@AmiralBl3ndic

Bug report

Describe the bug

When initiating a Google OAuth2 flow via the Supabase web SDK in responsive mode (in my case in MS Edge browser, with iPad responsive emulation), Google blocks the request as a "403 disallowed_useragent".
When disabling the responsive device emulation, everything works again.

To Reproduce

  1. Follow the steps as described in the documentation.
  2. Open the browser dev tools
  3. Enable responsive mode and choose a device (in my case, an iPad Pro 11")
  4. Initiate a Google OAuth2 flow with:
supabase.auth.signIn({
  provider: 'google',
});

Expected behavior

When initiating an OAuth flow in a mobile device (as a responsive emulation in the browser), Google should not reject the request, just like it does without responsive device emulation.

Screenshots

This is the error screen I'm getting from Google.

image

System information

  • OS: Windows 10
  • Browser (if applies): Microsoft Edge
  • Version of supabase-js: 1.21.0
  • Version of Node.js: 16.6.1

Additional context

Leads

This seems to be related to recent changes in the Google OAuth2 policy that disallow webview user agents to perform OAuth2 requests.

Workarounds

I have none in that case, I am developing a PWA that must be installed on an iPad but must also be available in the browser.
If you aren't developing a PWA, disabling responsive device emulation works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions