Skip to content
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

[Bug]: When authentication with to start process not authenticating with current verision #95

Open
kennyb7322 opened this issue Mar 27, 2024 · 1 comment
Labels
not a bug Not a bug

Comments

@kennyb7322
Copy link

What happened?
When running the script as a normal any shape on this iteration we are not able to run or process the application based on logging in to environment after being prompted with MFA. We have all the access but we are not able to get past the authentication issue I did attempt to include screen clip of the what error that is saying and captured it as well to a clipboard.

error1
error2

Captured to Clipboard
Request Id: e97706fb-1e80-481e-a1ee-446a2e544e01
Correlation Id: 5c9e9bf0-bedf-4dec-9faf-63646be4d534
Timestamp: 2024-03-27T21:03:27Z
Message: AADSTS50011: The redirect URI 'http://localhost:65341' specified in the request does not match the redirect URIs configured for the application '9bc3ab49-b65d-410a-85ad-de819febfddc'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

How to reproduce it
We simply run the following as an example from powershell as administrator the following
$param = @{
Instance = 'Microsoft365';
Analysis = 'SharePointOnline';
PromptBehavior = 'SelectAccount';
IncludeEntraID = $true;
ExportTo = ‘HTML’;
}
$assets = Invoke-Monkey365 @param

We also normally run it like this but it fails again with the same authentication issue this has worked without any issues in the past on the earlier version

$assets = .\Invoke-Monkey365 -ExportTo CSV,JSON,EXCEL,HTML,PRINT -OutDir “C:\monkey365\outdir"  -PromptBehavior SelectAccount -IncludeEntraID -Instance Microsoft365 -Analysis ExchangeOnline,MicrosoftTeams,SharePointOnline,Purview

Expected behavior
We would think that it would execute after it has started but it does not complete

Screenshots or Logs
If applicable, add screenshots to help explain your problem.
Also, you can add logs (Please anonymize them first!). The following command may help to share a log
Invoke-Monkey365 -Instance...... -Verbose -Debug -InformationAction Continue -WriteLog then attach here monkey365_exceptions_%date%.log

From where are you running Monkey365?
Please, complete the following information:

  • Resource: workstation
  • OS: Windows 11
  • PowerShell Version 7.4.1
  • Monkey365 Version:0.91.1-beta
  • Others:

Additional context Output of file
[21:01:45:338] - [Get-MonkeyMSALToken] - MSAL.NetCore.4.57.0.0.MsalUiRequiredException:
ErrorCode: invalid_grant
Microsoft.Identity.Client.MsalUiRequiredException: 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 '797f4846-ba00-4fd7-ba43-dac1f8f63013'. Trace ID: 17e0d3bd-c850-4162-8a02-0f8489a15200 Correlation ID: f54f4ab8-24e8-481b-8acc-56875c3e401c Timestamp: 2024-03-27 21:01:44Z
at Microsoft.Identity.Client.Internal.Requests.Silent.SilentRequest.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.ApiConfig.Executors.ClientApplicationBaseExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenSilentParameters silentParameters, CancellationToken cancellationToken)
StatusCode: 400
ResponseBody: {"error":"invalid_grant","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 '797f4846-ba00-4fd7-ba43-dac1f8f63013'. Trace ID: 17e0d3bd-c850-4162-8a02-0f8489a15200 Correlation ID: f54f4ab8-24e8-481b-8acc-56875c3e401c Timestamp: 2024-03-27 21:01:44Z","error_codes":[50076],"timestamp":"2024-03-27 21:01:44Z","trace_id":"17e0d3bd-c850-4162-8a02-0f8489a15200","correlation_id":"f54f4ab8-24e8-481b-8acc-56875c3e401c","error_uri":"https://login.microsoftonline.com/error?code=50076","suberror":"basic_action"}
Headers: Cache-Control: no-store, no-cache
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
P3P: CP="DSP CUR OTPi IND OTRi ONL FIN"
client-request-id: f54f4ab8-24e8-481b-8acc-56875c3e401c
x-ms-request-id: 17e0d3bd-c850-4162-8a02-0f8489a15200
x-ms-ests-server: 2.1.17615.11 - SCUS ProdSlices
x-ms-clitelem: 1,50076,0,1192.7182,
x-ms-srs: 1.P
X-XSS-Protection: 0
Set-Cookie: fpc=AuqpzHxC4edIpwgLZ6BWqUEOv9wHAQAAACSAlt0OAAAAPSbFtgEAAAA2gJbdDgAAAHTj9WUBAAAAOICW3Q4AAAA; expires=Fri, 26-Apr-2024 21:01:44 GMT; path=/; secure; HttpOnly; SameSite=None, x-ms-gateway-slice=estsfd; path=/; secure; httponly
Date: Wed, 27 Mar 2024 21:01:44 GMT
. LineNumber: - exception - <> -
[21:01:46:708] - [at Get-M365ATPLicense, C:\program files\powershell\7\Modules\monkey365\core\tenant\Get-M365ATPLicense.ps1: line 65] - The property 'SKU' cannot be found on this object. Verify that the property exists.. LineNumber: At C:\program files\powershell\7\Modules\monkey365\core\tenant\Get-M365ATPLicense.ps1:41 char:12

  •     if($null -ne $O365Object.Tenant.SKU){
    
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - exception - <<Redacted>> - M365ATPInfoError
    

[21:01:47:890] - [at Get-M365AADLicense, C:\program files\powershell\7\Modules\monkey365\core\tenant\Get-M365AADLicense.ps1: line 59] - The property 'SKU' cannot be found on this object. Verify that the property exists.. LineNumber: At C:\program files\powershell\7\Modules\monkey365\core\tenant\Get-M365AADLicense.ps1:48 char:12

  •     if($null -ne $O365Object.Tenant.SKU){
    
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - exception - <<Redacted>> - M365AADInfoError
    
@kennyb7322 kennyb7322 added bug Something isn't working status/needs-triage Needs triage labels Mar 27, 2024
@silverhack silverhack added not a bug Not a bug and removed bug Something isn't working status/needs-triage Needs triage labels Mar 28, 2024
@silverhack
Copy link
Owner

silverhack commented Mar 28, 2024

Hi @kennyb7322 thanks for the explanation, it's really appreciated.

Apparently it's not a bug, and you're executing Monkey365 in a wrong way. Regarding SharePoint Online, some options are not available depending on which PowerShell version is used to execute the tool.

Please, see the docs with details about available options to avoid authentication issues and how to execute Monkey365 when SharePoint Online is used.

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Not a bug
Projects
None yet
Development

No branches or pull requests

2 participants