Giter Site home page Giter Site logo

Comments (10)

Kav7 avatar Kav7 commented on June 19, 2024 1

That worked! Very nice :)

from aadinternals.

NestoriSyynimaa avatar NestoriSyynimaa commented on June 19, 2024

Are you running the command in PowerShell or ISE? VS Code is currently not supported for interactive logon.
If you don't use MFA, you can save credentials to a variable and then get the accesstoken.
$Cred = Get-Credential
Get-AADIntAccessTokenForAADJoin -SaveToCache -Credentials $Cred

from aadinternals.

pawp81 avatar pawp81 commented on June 19, 2024

I am running it in PowerShell.
Yes I am using PowerShell so the option -Credentials parameter didn't work:

from aadinternals.

NestoriSyynimaa avatar NestoriSyynimaa commented on June 19, 2024

Do you have any error reports for the non-working Get-AADIntAccessTokenForAADJoin -SaveToCache -Credentials $Cred?

from aadinternals.

pawp81 avatar pawp81 commented on June 19, 2024
Get-AADIntAccessTokenForAADJoin -SaveToCache -Credentials $Cred
Invoke-RestMethod : {"error":"interaction_required","error_description":"AADSTS50076: Due to a configuration change
made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access
'01cb2876-7ebd-4aa4-9cc9-d28bd4d359a9'.\r\nTrace ID: 2b627b3e-bf70-429e-8c62-538c6a217100\r\nCorrelation ID:
54aadd25-9fbf-46ee-8f13-ecab888406b3\r\nTimestamp: 2021-01-22 11:55:18Z","error_codes":[50076],"timestamp":"2021-01-22
11:55:18Z","trace_id":"2b627b3e-bf70-429e-8c62-538c6a217100","correlation_id":"54aadd25-9fbf-46ee-8f13-ecab888406b3","e
rror_uri":"https://login.microsoftonline.com/error?code=50076","suberror":"basic_action"}
At C:\Program Files\WindowsPowerShell\Modules\AADInternals\0.4.4\AccessToken_utils.ps1:2510 char:19
+ ...   $response=Invoke-RestMethod -Uri $url -ContentType $contentType -Me ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Could not get Access Token!
At C:\Program Files\WindowsPowerShell\Modules\AADInternals\0.4.4\AccessToken_utils.ps1:2437 char:13
+             Throw "Could not get Access Token!"
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not get Access Token!:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not get Access Token!

from aadinternals.

NestoriSyynimaa avatar NestoriSyynimaa commented on June 19, 2024

Okay, seems that your organisation requires MFA so the credentials wont work. Back to the original issue then.
You are probably using a quite recent Windows 10, which is missing a registry key HKCU:\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

As a workaround, you can create the missing registry key and add the value of 0x00002af9 for powershell.exe and powershell_ise.exe as illustrated below. After that, start a new PS session and the original command should work.

image

I'll fix this issue for the next release.

from aadinternals.

Kav7 avatar Kav7 commented on June 19, 2024

I have same issue unfortunately, I checked and already had those reg keys.

from aadinternals.

NestoriSyynimaa avatar NestoriSyynimaa commented on June 19, 2024

Are you also trying to use saved credentials and MFA is required? Any error messages?

from aadinternals.

Kav7 avatar Kav7 commented on June 19, 2024

I tried with an account that doesnt have MFA and after entering the password in the popup box, it just goes blank white, I eventually close it which causes this error:

Could not get OAuthInfo!
At C:\Program Files\WindowsPowerShell\Modules\AADInternals\0.6.2\AccessToken.ps1:1327 char:17

  •             throw "Could not get OAuthInfo!"
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Could not get OAuthInfo!:String) [], RuntimeException
    • FullyQualifiedErrorId : Could not get OAuthInfo!

from aadinternals.

NestoriSyynimaa avatar NestoriSyynimaa commented on June 19, 2024

Another bug due to recent changes :(
Try to comment out the line 1322 in AccessToken_utils.ps1 and remove and import module:
# $web.ScriptErrorsSuppressed = $True

from aadinternals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.