-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targeting NET Standard #30
Comments
Yes, would be great to have it work on Core. For auth, I think we'd need to switch to a model like what xplat CLI is doing. It gives you some code that you have to paste in a browser page, and then auth continues without needed to ever pop up UI. It's just too hard to pop up a browser window in a portable way. Here is what it looks like with cli, though I don't know about implementation:
|
I saw that in the Mac PowerShell and az as well, so it must be coming from ADAL. I'll do some detective work since PowerShell is now open. This magic must be revealed. |
Alright, so it's called OAuth 2.0 Device Flow Grant, it's in ADAL and it goes like this:
Result:So it's definitely doable. I'll take a shot at adding it to ARMClient (unless you guys want to do it - i'm finding it difficult to commit time lately). Vittorio's blog post on ADAL 3.x and Device Flow here: |
Ha yes, now that I hear 'device flow', that rings a bell from some thread I was on when they were coming up with it for xplat CLI. If you can make it work here, that's awesome. And hopefully that's the only thing preventing it from using Core (or Mono). The rest should be very portal http request logic. |
Well, Device Flow login now works (build this branch) but i broke the X509 cert auth in the process and i'm not sure how to get out of this one:
Not sure about:
I'm still fixing and testing but would value your input here @davidebbo @ahmelsayed |
Looks like i broke the token refresh mechanism.
Which i believe is this line here. Well, back to the drawing board. |
Presumably, the xplat CLI is able to continue to work after one hour? Sorry, I'm not very familiar with the refresh mechanism. |
Yes it is. I suspect i'm not saving the correct thing to offline cache with ADAL 3. I'll figure it out. |
Any plans to make armclient cross-platform by porting to .NET Core? Would be handy to have it in Cloud Shell, Linux and Mac. |
I believe this effort is now abandoned in favor of Azure CLI's Example -
|
Thanks @snobu! |
Judging by the output of ApiPort it may or may not be a big effort to target NET Standard instead of full NET Framework :)
Given ARMClient is such a handy thing to have around i wonder if we could port this over so it runs on NET Core cross-plat.
Currently it doesn't seem to work on Mono - complains about missing Windows Forms when trying to authenticate. Although it MIGHT work if you manage to produce the token cache some other way.
Just a thought..
The text was updated successfully, but these errors were encountered: