To implement Yahoo OAuth correctly, make sure you're using the OAuth2 Authorization Code Flow rather than the "Sign in with Yahoo" guide, which follows a different flow.
When creating your app, ensure you select Confidential Client as the client type. This option is necessary to support secure and server-side token handling, which is ideal for scenarios where you need to keep the client secret secure on the server.