the frontend doesn't really have access to the session to verify the state field when it's an external web app or an SPA application.
@skeith22 Pick an appropriate grant type in that case. By the sounds of it, the Authorization Code Grant with PKCE sounds more appropriate:
The Authorization Code grant with "Proof Key for Code Exchange" (PKCE) is a secure way to authenticate single page applications or native applications to access your API. This grant should be used when you can't guarantee that the client secret will be stored confidentially or in order to mitigate the threat of having the authorization code intercepted by an attacker.