Issue Setting Up OAuth
shawhint
HOBBYOP

a year ago

Hello all, I'm new here so I'm probably missing something simple.

I deployed a FastHTML web app that uses Google OAuth. The app deploys and runs fine, however, when I go to sign in with Google, I get an error saying...

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

The issue seems to be that the request is sent via HTTP rather than HTTPS, which is a requirement for Google's OAuth policy.

Any advice on getting OAuth working?

6 Replies

brody
EMPLOYEE

a year ago

Hello,

You would need to be using https.


shawhint
HOBBYOP

a year ago

Sorry if this is a noob question, but how do I do that?


brody
EMPLOYEE

a year ago

Wherever you are using http://, use https://

http -> https


shawhint
HOBBYOP

a year ago

Sounds simple enough... the process is a bit abstracted by FastHTML so I'll do some hacking and report back :)


shawhint
HOBBYOP

a year ago

Got it! I knew it was a simple fix sweat_smile emoji

In case anyone else has this issue I made the following change.

# changed this...
redir = redir_url(request, '/auth_redirect')

# to this...
redir = f"{request.url.scheme}://{request.url.netloc}/auth_redirect"

brody
EMPLOYEE

a year ago

Awsome!


Loading...