Skip to content

AppStream 2.0 Unable to authorize the session. (Error Code: INVALID_AUTH_POLICY);Status Code:401

0

I am setting up app streaming with active directory services following along with this tutorial. I am using IAM Identity Center as the identity provider, and an AWS Managed Microsoft AD for the directory.

After completing these steps, I can

  • access the application portal associated the identity provider by logging in with a user from the active directory
  • click on the application linked to my AppStream 2.0 stack
  • select either 'Continue with browser' or 'Open AppStream 2.0 client'

However, then I am given the error Unable to authorize the session. (Error Code: INVALID_AUTH_POLICY);Status Code:401.

I have attached the trust policy, the inline policy, and the relay status below. Note that, if I remove the condition from the trust policy, then I do not get the error and can connect without issue. I don't think I want to do that though xD

Please let me know if there is any more information that would be helpful. Thanks :)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::0123456789:saml-provider/identity-provider"
            },
            "Action": "sts:AssumeRoleWithSAML",
            "Condition": {
                "StringEquals": {
                    "SAML:sub_type": "persistent"
                }
            }
        }
    ]
}
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": "appstream:Stream",
			"Resource": "arn:aws:appstream:eu-west-2:0123456789:stack/stack-name",
			"Condition": {
			    "StringEquals": {
			        "appstream:userId": "{saml:sub}"
			    }
			}
		}
	]
}

https://appstream2.euc-sso.eu-west-2.aws.amazon.com/saml?stack=stack-name&accountId=0123456789

asked a year ago847 views

1 Answer
0
Accepted Answer

There is a missing $ in the line "appstream:userId": "{saml:sub}" of the inline policy. It should read "appstream:userId": "${saml:sub}".

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.