Comments (10)
That worked! Very nice :)
from aadinternals.
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.
I am running it in PowerShell.
Yes I am using PowerShell so the option -Credentials parameter didn't work:
from aadinternals.
Do you have any error reports for the non-working Get-AADIntAccessTokenForAADJoin -SaveToCache -Credentials $Cred
?
from aadinternals.
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.
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.
I'll fix this issue for the next release.
from aadinternals.
I have same issue unfortunately, I checked and already had those reg keys.
from aadinternals.
Are you also trying to use saved credentials and MFA is required? Any error messages?
from aadinternals.
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.
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)
- New-AADIntBulkPRTToken Request Failing HOT 4
- "ObjectId" in device certificate should be renamed to "AuthUserObjectId" HOT 4
- Error when attempting to import module in powershell core HOT 1
- Azure Government / national cloud support HOT 4
- Federated identities are not supported HOT 3
- Rename Repo from AADInternals to MSEntraIDInternals 🤣 HOT 2
- Possible authentication issue with “TROOPERS23 edition”. HOT 1
- Dependencies - List HOT 1
- Install getting blocked by AV HOT 1
- Get MFA token HOT 1
- Allow suppression of import-module message HOT 2
- Add Support for SQL(Express) for Get-AADIntSyncCredentials HOT 1
- Authentication issue after updating to 0.9.1 HOT 3
- Support AAD device token flows
- aadsync_client_build = 1.5.29.0 broken
- Cannot login to tenant with Get-AADIntAccessTokenForAADGraph HOT 1
- Does AADInternals works in macOS?
- Incompatible parameter sets in Open-AADIntOffice365Portal
- KeySignTest : FAILED (transport key) HOT 1
- AccessToken_utils.ps1 - ConvergedProofUpRedirect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aadinternals.