Closed MarcinPawlicaFS closed 8 months ago
No idea why Okta doesn’t like that. It follows the spec of state parameters. Perhaps ask Okta why json in the state parameter isn’t supported ?
wow, that was a quick response :) Thanks, will do, was hoping this has happened somewhere else already
Hmm, according to Okta docs:
state - A value to be returned in the token. The client application can use it to remember the state of its interaction with the end user at the time of the authentication call. It can contain alphanumeric, comma, period, underscore, and hyphen characters.
Maybe urlencoding the curly brackets in the URL would help?
Just make sure you’re on the latest version of WinUIEx - there was a recent change to encoding of the url
Maybe urlencoding the curly brackets in the URL would help?
try it manually and see what happens
I am not, because for some reason I can't change the MicrosoftAppSdk version to 1.4x, so I'm on 2.1.0. That would explain a lot...
for some reason I can't change the MicrosoftAppSdk version to 1.4x
why not? If you’re using Maui see the doc: https://dotmorten.github.io/WinUIEx/concepts/Maui.html#include-winuiex-package-in-windows-target
Thank you, for some reason this didn't work for me initially, but now it did - managed to get 2.3.0 working. However, the curly brackets are not urlencoded. I tried urlencoding them manually, and it works, although the callback is not reaching my running app instance, but opening a new one instead... but this may be because it can't recognize the id due to the urlencoding. I'll have a look later to confirm.
OK, so I had to copy your code into a temp project of mine, but in the end replacing curly brackets with url codes did the trick with Okta:
process.StartInfo.Arguments = $"url.dll,FileProtocolHandler \"{authorizeUri.ToString().Replace("\"", "%22").Replace("{", "%7B").Replace("}", "%7D")}\"";
Thanks for confirming. I'll have a look and see what we can do here
Fixed in v2.3.3
Hi, first of all - awesome library! However, when trying to use WebAuthenticator in Windows (because the native one still isn't fixed!), I am getting an HTTP 400 - BAD REQUEST error from Okta. I managed to narrow it down to the "state" json object in the query:
I noticed in your code, that you are transforming the initial "state" in the BrowserOptions url into an object by adding two properties to the original state, namely
appInstanceId
andsigninId
. Unfortunately, this causes Okta to return the above error. Do you know any way around that?