@Benoit LeBlanc
The problem was caused by the "code" query parameter in the oauth callback URL. I forget the details exactly as I learned them from Microsoft Tech Support, but the code parameter is used internally within the Static Web App system which causes conflicts when trying to access that parameter in your function.
The solution is to create a proxy which will intercept the callback, change the name of the code parameter, and direct the call to your original function.
In the proxies.json file within your api folder, use this template to solve your problem:
proxies.json
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"callback": {
"matchCondition": {
"methods": [ "GET" ],
"route": "/api/CatchYahooCallbackProxy"
},
"backendUri": "http://localhost/api/CatchYahooCallback",
"requestOverrides": {
"backend.request.querystring.code": "",
"backend.request.querystring._code": "{request.querystring.code}"
}
}
}
}