-
Notifications
You must be signed in to change notification settings - Fork 566
ms-rest-azure.interactiveLogin callback always returns 'authorization_pending' error (in React Electron) #2002
Comments
I am not able to understand why would the callback immediately return. The grunt work is done by adal-node. The code that we have is a simple wrapper on it. adal-node does a blocking call for interactive login. adal-node should be handling the retry scenario correctly (if that is indeed a valid use case). |
Just to +1 this, we saw this issue in a command-line Node based app as well. As soon as the message was printed to the console, the callback will immediately return with an |
I have the same issue trying to use interactive login. Digging around a bit I found that azure package brought in an old async library (v0.9) that was not able to parse the options object passed to the retry function. So we ended up retrying 5 times with no delay (default behavior) |
Ah I see. We will investigate further by bumping the version of async. If everything passes then we will take a dependency on newer version of async. |
Update: A newer version of "ms-rest-azure": "2.3.5" has been published which takes an explicit dependency on async version 2.5.0 and has the retry logic baked into it. Hope this should resolve the issue. Let us know if you find more issues. |
Resolves #42 upstream (see Azure/azure-sdk-for-node#2002)
Issue:
When I call interactiveLogin, my callback is almost immediately called and it's given an error:
authorization_pending
.This seemed strange to me, because it seems like it normally waits around for a bit when I'm doing a normal Node application, but I'm doing an Electron application and this call is actually taking place in a React component. I dove down through adal-node code, etc., but it doesn't look like they handle retry/etc. I felt like maybe this method should be attempting to retry for me.
Workaround:
I decided the way of getting around this for now is to add retry, so I ended up modifying interactive login to have retry baked into the
acquireTokenWithDeviceCode
step. Not necessarily the cleanest code, but it works now. :)Not entirely sure if supporting Electron is actually important for ya'll. I'll likely just create a fork or a custom library for my purposes. I also had to create a custom version of adal-node which didn't read in the package.json from a relative directory. Just thought I'd raise this here since it did take a good couple of hours out of my day.
The text was updated successfully, but these errors were encountered: