OAuth for Google expects backendless domain not my custom domain

Hi Backendless Team!

When configuring OAuth on google side, I used my custom domain as redirect uri:
https://app./api/users/oauth/googleplus/authorize

This results in an error on Google Consent screen:
Error 400: redirect_uri_mismatch

When looking into error, it shows:

Error 400: redirect_uri_mismatch

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.
Request details: redirect_uri=https://<myBackandlessSubdomain>.backendless.app/api/users/oauth/googleplus/authorize flowName=GeneralOAuthFlow 

When I add this subdomain into Googles OAuth configuration, Now I am able to access Consent Screen, but it displays backendless.app as the app I will be logging into, not my custom domain app.

So the issue is that my custom domain is not used into request sent to google, how can we change that?

Best Regards,
Uldis

Hello, @Uldis_Borkus

Could you please provide your App ID?

Regards,
Serhiy

Hi @Serhiy_Melnychuk
Here is the id: F001F3BF-4CCD-B35E-FFD0-23845DEE6000

BR,
Uldis

  1. You should add callbackUrl with your domain to Google Settings
  2. When you get request url, you should add it to body

Your request should look like this:

curl --location ‘https://dev.cenupulss.lv/api/users/oauth/googleplus/request_url
–header ‘Content-Type: application/json’
–data ‘{“callbackUrlDomain”:“dev.cenupulss.lv”, “redirect”:true}’

On Google side I have entered URI i got from backendless (Users > Auth Providers > Google):
image

When on login screen I previously triger my logic:
image

looks like default callback urI is used the one that is subdomain of backendless.

Regarding the curl request you added, how this should be passed using codeless?

Is this the correct way (added domain in the callback URI connector):

image

For now seems to be working.

Hello, @Uldis_Borkus

Sorry for the delayed response.
Yes, that’s correct; it should work.

Regards,
Serhiy

1 Like