SupabaseS
Supabase2mo ago
capo

Supabase (Self-Hosted) w/ Azure OAuth

Hello,

I'm having a problem I've been dealing with for days figuring out.

selfhosted supabase: https://my.example.com/auth/v1/callback

local react app: http://localhost:5175 (10.10.0.254:5175)

supabase .envs

SITE_URL=http://localhost:5175
ADDITIONAL_REDIRECT_URLS=http://localhost:5175/**

LOGIN METHOD:

const handleMicrosoftLogin = async (event: React.MouseEvent<HTMLButtonElement>) => {
event.preventDefault();
try {
setLoading(true)
setError(null)

const { error } = await supabase.auth.signInWithOAuth({
provider: 'azure',
options: {
scopes: 'openid email profile', },
})

if (error) throw error
} catch (err: any) {
setError(err.message || 'An error occurred during login')
setLoading(false)
}
}

WHAT'S HAPPENING? - i login with oauth (attempt to), i land on https://my.example.com/auth/v1/callback with a ?code and session_state and don't get redirected to localhost:5175 (my local testing app)

works just fine if i use supabase cloud though, i'm beyond fed up with this.
Was this page helpful?