Skip to content

Commit

Permalink
Support specifying custom OAuth scope (#619)
Browse files Browse the repository at this point in the history
For OpenID connect over OAuth, at least `openid profile` need to be set
there, but since the email is also used, the `email` scope will instruct
the OpenID provider to also deliver that.

---------

Co-authored-by: Baptiste Arnaud <contact@baptiste-arnaud.fr>
  • Loading branch information
nebulade and baptisteArno authored Jul 20, 2023
1 parent 3952ae2 commit 48f074c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/builder/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ if (isNotEmpty(process.env.CUSTOM_OAUTH_WELL_KNOWN_URL)) {
id: 'custom-oauth',
name: process.env.CUSTOM_OAUTH_NAME ?? 'Custom OAuth',
type: 'oauth',
authorization: {
params: {
scope: process.env.CUSTOM_OAUTH_SCOPE ?? 'openid profile email'
}
},
clientId: process.env.CUSTOM_OAUTH_CLIENT_ID,
clientSecret: process.env.CUSTOM_OAUTH_CLIENT_SECRET,
wellKnown: process.env.CUSTOM_OAUTH_WELL_KNOWN_URL,
Expand Down
1 change: 1 addition & 0 deletions apps/docs/docs/self-hosting/configuration/builder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/azure-
| CUSTOM_OAUTH_USER_NAME_PATH | name | Used to map the name from the user info object |
| CUSTOM_OAUTH_USER_EMAIL_PATH | email | Used to map the email from the user info object |
| CUSTOM_OAUTH_USER_IMAGE_PATH | image | Used to map the image from the user info object |
| CUSTOM_OAUTH_SCOPE | openid profile email | OAuth scope |

For `*_PATH` parameters, you can use dot notation to access nested properties (i.e. `account.name`).

Expand Down

4 comments on commit 48f074c

@vercel
Copy link

@vercel vercel bot commented on 48f074c Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 48f074c Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

viewer-v2 – ./apps/viewer

bii.bj
1stop.au
wasap.nl
x.cr8.ai
yobot.me
klujo.com
me.cr8.ai
wachat.io
wassep.io
247987.com
8jours.top
aginap.com
ai.mprs.in
bee.cr8.ai
bot.aws.bj
bot.bbc.bj
cat.cr8.ai
finplex.be
jxi.cr8.ai
nepkit.com
pig.cr8.ai
sat.cr8.ai
typebot.io
wachats.me
wsapio.com
blogely.com
bot.aipr.kr
bot.joof.it
bot.kloo.me
broprio.com
bull.cr8.ai
docs.cr8.ai
getyour.sbs
icon.cr8.ai
minipost.uk
mole.cr8.ai
nurraysa.me
team.cr8.ai
wolf.cr8.ai
ai.meant.com
bet7k.online
bot.afric.ai
bot.grace.bj
cinecorn.com
gniorder.com
help.taxt.co
kusamint.com
receita.info
info.clickasuransi.com
kodawariab736.skeep.it
mdb.diego.progenbr.com
michaeljackson.riku.ai
premium.kandabrand.com
psicologiacognitiva.co
report.gratirabbit.com
resume.gratirabbit.com
teambuilding.hidden.sg
whatsappwebsite.com.br
whatsappwebsite.online
83242573.actualizar.xyz
87656003.actualizar.xyz
88152257.actualizar.xyz
91375310.actualizar.xyz
app.youvisitedthis.site
viewer-v2-typebot-io.vercel.app
mdb.assessoria.mauricio.progenbr.com
form.shopmercedesbenzsouthorlando.com
mdb.evento.equipeinterna.progenbr.com
bot.studiotecnicoimmobiliaremerelli.it
mdb.assessoria.boaventura.progenbr.com
mdb.assessoria.jtrebesqui.progenbr.com
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
gabinete.baleia.formulario.progenbr.com
mdb.assessoria.carreirinha.progenbr.com
chrome-os-inquiry-system.itschromeos.com
mdb.assessoria.paulomarques.progenbr.com
viewer-v2-git-main-typebot-io.vercel.app
main-menu-for-itschromeos.itschromeos.com
mdb.assessoria.qrcode.ademir.progenbr.com
mdb.assessoria.qrcode.arthur.progenbr.com
mdb.assessoria.qrcode.danilo.progenbr.com
mdb.assessoria.qrcode.marcao.progenbr.com
mdb.assessoria.qrcode.marcio.progenbr.com
mdb.assessoria.qrcode.aloisio.progenbr.com
mdb.assessoria.qrcode.girotto.progenbr.com
mdb.assessoria.qrcode.marinho.progenbr.com
mdb.assessoria.qrcode.rodrigo.progenbr.com
mdb.assessoria.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.desideri.progenbr.com
mdb.assessoria.qrcode.fernanda.progenbr.com
mdb.assessoria.qrcode.jbatista.progenbr.com
mdb.assessoria.qrcode.mauricio.progenbr.com
mdb.assessoria.fernanda.regional.progenbr.com
mdb.assessoria.qrcode.boaventura.progenbr.com
mdb.assessoria.qrcode.jtrebesqui.progenbr.com
mdb.assessoria.qrcode.carreirinha.progenbr.com
mdb.assessoria.qrcode.paulomarques.progenbr.com
mdb.assessoria.qrcode.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.fernanda.regional.progenbr.com

@vercel
Copy link

@vercel vercel bot commented on 48f074c Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 48f074c Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

Please sign in to comment.