supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
478 stars 120 forks source link

Unclear how to define domain workspace only (e.g. hd="domain.com") with Google login #181

Closed accesstechnology-mike closed 1 year ago

accesstechnology-mike commented 1 year ago

Is it possible to restrict login to a specific Google Workspace domain (e.g. using the 'hd' parameter)?

https://developers.google.com/identity/openid-connect/openid-connect#hd-param

silentworks commented 1 year ago

I haven't tested this but you should be able to do

<Auth 
  supabaseClient={supabase}
  providers={['google']}
  queryParams={{
    hd: 'mycollege.edu'
  }}
/>
accesstechnology-mike commented 1 year ago

That's got it, thanks. Required update to latest release to recognise queryParams