Hi, I'm calling OAuthUserCredential.CreateAsync() in a try / catch block. This call gets routed to my own implementation of OAuthAuthorizeHandler.AuthorizeAsync().
From the authorizeUri parameter of AuthorizeAsync(), I can see the SDK passed in a "code_challenge" hash string. But since I don't know the verifier, I have to replace the challenge with my own for PKCE.
I generated a pair of "code_challenge" and "code_verifier" strings (Using default Base64Url.EncodeToString(), SHA256.Create()). I sent the "code_challenge" string in my OAuth2 authorization request. The "code_challenge_method" is "S256". This completes successfully and I get a code.
Then in my request to "https://www.arcgis.com/sharing/rest/oauth2/token, I have "code_verifier" set to the one I generated. I have "grant_type" set to "authorization_code". Along with other required parameters.
The response comes back with Status 200, OK. Using a JSON De-serializer on the response stream, I was able to extract the username, access token, refresh token ... etc. I then add these to a dictionary and return the dictionary in AuthorizeAsync().
After exiting from AuthorizeAsync(), the code went into my catch block (even though there was no exceptions in AuthorizeAsync()). The error was {"error":{"code":400,"error":"invalid_request","error_description":"Invalid PKCE code_challenge_verifier","message":"Invalid PKCE code_challenge_verifier","details":[]}}.
Is this a bug ? Or was I supposed to use the code_challenge provided by the SDK (if so how would I know the code_verifier).
.NET 9.0.302, Maui 9.0.100, ArcGIS Runtime 200.7 (also happens 200.8)