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

Unable to set credentials: Root element is missing. #360

Closed
1 task
KezHalls opened this issue Oct 15, 2024 · 7 comments
Closed
1 task

Unable to set credentials: Root element is missing. #360

KezHalls opened this issue Oct 15, 2024 · 7 comments
Assignees
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. module/powershell-cmdlets p2 This is a standard priority issue

Comments

@KezHalls
Copy link

KezHalls commented Oct 15, 2024

Describe the bug

Unable to set credentials: Root element is missing. I get this error when I try to create a connection to AWS.
The account I am using is MFA exempted and access to aws. I had a job logged with AWS and they said I need to log it with you as they cannot find the issue.

Followed all posts
https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up-windows.html
https://docs.aws.amazon.com/powershell/latest/userguide/saml-pst.html
https://repost.aws/knowledge-center/adfs-grant-ad-access-api-cli#

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

a successful connection to aws is made

Current Behavior

h endpoint to verify role data...
Set-AWSSamlRoleProfile:
Line |
11 | Set-AWSSamlRoleProfile -EndpointName $epName -NetworkCredential $cred …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to set credentials: Root element is missing.

Reproduction Steps

#$credential = New-Object System.Management.Automation.PSCredential($userName, (ConvertTo-SecureString $password -AsPlainText -Force))
$Credential = Get-Credential -Message "Enter the domain credentials for the endpoint"
$endpoint = "https://launcher.myapps.microsoft.com......d"
$epName = Set-AWSSamlEndpoint -Endpoint "$endpoint" -StoreAs 'ADFS-Login' -AuthenticationType NTLM
Set-AWSSamlRoleProfile -EndpointName $epName -NetworkCredential $credential -StoreAs SAMLDemoProfile -Verbose

Possible Solution

No response

Additional Information/Context

No response

AWS Tools for PowerShell version used

AWS.Tools.EC2 3.7.403.1
AWS.Tools.SSO 3.7.400.5
AWS.Tools.SSOOIDC 3.7.400.5

PowerShell version used

Name Value


PSVersion 7.2.2
PSEdition Core
GitCommitId 7.2.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Operating System and version

windows 10

@KezHalls KezHalls added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2024
@bhoradc bhoradc added module/powershell-cmdlets p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2024
@ashishdhingra ashishdhingra self-assigned this Oct 15, 2024
@ashishdhingra ashishdhingra added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Oct 15, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Oct 16, 2024

@KezHalls Good afternoon. Could you please share the following:

Just for reference, Set-AWSSamlRoleProfile CmdLet uses SAMLAuthenticationController here. SAMLAuthenticationController.GetSAMLAssertion() tries to parse response here.

Based on shared error line endpoint to verify role data,

If you refer How an Identity-Federated User Gets Federated Access to AWS Service APIs, in the 1st step, the client on federated user's computer authenticates against AD FS. If authentication succeeds, AD FS sends the user a SAML assertion. In your use case, SAML assertion might be missing/empty.

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 16, 2024
@KezHalls
Copy link
Author

Thankyou for such a thorough response. I think I see what you are saying in terms where the failure maybe occurring.

Unfortunately the response logging is not working... or at least not creating the log file so I am unable to share anything and am having troubleshooting that.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 22, 2024
@KezHalls
Copy link
Author

I wondered if there is anymore feedback on this. After conversations with MS this method will be the only way we will be able to achieve our goal.

@ashishdhingra
Copy link
Contributor

ashishdhingra commented Oct 22, 2024

Thankyou for such a thorough response. I think I see what you are saying in terms where the failure maybe occurring.

Unfortunately the response logging is not working... or at least not creating the log file so I am unable to share anything and am having troubleshooting that.

@KezHalls I'm unsure if you are -Source parameter for Add-AWSLoggingListener MyAWSLogs C:\logsaws.txt. Also note that c:\logsaws.txt is path to log file and it should be writable. This could be any path.

So at high level, we would use below commands:

Add-AWSLoggingListener MyAWSLogs C:\logsaws.txt
Set-AWSResponseLogging Always
Enable-AWSMetricsLogging

Once the logs are collected, we could turn off response logging:

Disable-AWSMetricsLogging
Remove-AWSLoggingListener Amazon MyAWSLog

Additionally, also check How to view a SAML response for troubleshooting.

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 22, 2024
@KezHalls
Copy link
Author

Apparently we use the AWS SSO service to handle the role mapping. We don't pass on the role mapping within the SAML assertion which is why this is not working and I won't be able to get it working. Back to the drawing board.
Thanks for the assistance.

@KezHalls
Copy link
Author

closing

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 24, 2024
@ashishdhingra ashishdhingra closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

aws-sdk-dotnet-automation pushed a commit that referenced this issue Oct 24, 2024
Remove Nimble Studio from Powershell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. investigating This issue is being investigated and/or work is in progress to resolve the issue. module/powershell-cmdlets p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants