Overview

This describes how to authenticate with Drupal using Nuxt 3 and @sidebase/nuxt-auth.

Background

The following article introduced a method for authenticating with GakuNin RDM.

The following article introduced a method for using Drupal OAuth from Next.js.

Using these as reference, we use Drupal OAuth from Nuxt 3.

Method

The source code can be found in the following repository.

https://github.com/nakamura196/nuxt-rdm

Specifically, the implementation is here.

https://github.com/nakamura196/nuxt-rdm/blob/main/server/api/auth/[…].ts

{},intcca}t}p}dayllu,o,r,:mpiitup}ka}or}eeeehra,es,fe;"::nnolrsrr}nyc}c}ci}ritineidttr:acee/:no)o)ofeludammr""ISimosduacncccgr};nmh}b;ntter:maauDodezpsppisp{sllore/see,os(hu(neigpra:car:eoreirtiidaduatta"dt!rrpp:leauurto:neR/eeeenisphdCyronr{r::lptueic{scuaqbnn:treiroeo,jewoop"ahstoepetnuuott_eR/edrnss{ffrpp,l"e:nsr__tted__ctcuas:sto.niiorr",R:sotuihsyisoytnu:enoetllfoo,uu.cyrm/tdenp_tt="nkwoeeiffns{eepiec(=:cteuihP{t=)k).liitense:Cacre:rm/aO-EeselliRvs:olonuexiecwSTa{rn{u.eemu..`nlnestt":CaaTywrsbn..enDe"$fbtwe:.aoli"pao:,aepCtRnc{iaeRpu`nlt,eirmmroiUvogcxUuuat$fb"t(jeaonmP.d(ktRnsrh{iaf:`siffeADe))LteaogcerToliiCLR".dSiRmr(kt"eonUlgo_U,nr{emusi)caskse(nAPeuaen.z.dhp.e}ep)fUAxprCtcanr(pjn;r.iTLtacoioteupls"o"dgH_AlhnmdixpriorsfNr(_Su`Pfeeotaocneuionu)UCt,aiCnAlca(qblup.ROhrg_u`et)u"eEladLPUa(nct,si;e.mllr,Erm)fohsosapa,Cu,ls.i"dU.ntsrilp(dg"ere/elia{r(,"lnxftfelu),v-PahePnCp..waierrUtladDwrlrosIilrRwseuevedeCuU-edsdi,nlpPf:e_dptiaAotruerSelLrh$'sdoenC_me{se"fctlT-rr,irIiOureunledeKresnaet,nEls.im,tNepsqeUS_notuFReUcnaeaLcRostlrLdeuIlaeesD"bstdbTUa,"oenci,dxkkm"ytna"}owg,o`when)ne{c;n(eUasndeojru"es,mtaialsSneetedneadm)epriority

Summary

There may be some errors, but I hope this serves as a helpful reference.