Quick bit of background. We are currently running a Vue 2 frontend which communicates with a Hapi.js backend. Authentication is via Microsoft Azure.
I am investigating migrating the front-end to Next whilst keeping (for the moment) the Hapi.js backend
I am having problems getting an Access Token from Microsoft that can be authenticated by the backend (or JWT.io)
If I register a new Application in Microsoft Entra and enter the details into a simple Nuxt Application running nuxt-auth-utils then I can receive a User and token that shows the correct user details for the selected user. However the supplied access_token has a nonce and does not validate on jwt.io.
The solution I can find is to register and expose an api in Entra. However as soon as I do that and add the scope block to my Nuxt Application I become unable to Authenticate with Microsoft.
scope: ['.default'] and scope: ['User.read'] both allow me to log in. It's only when I change the scope to scope: ['Custom.Read] (as registered on Entra) I get a failure.
I assume that I am missing somehing in the MS registration, rather than the nuxt-auth-utils