Hi, Aliaksandr!
Thank you for your reply!
At first for AWS the main doc is here [http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html)
This is the source of another related docs about configuring AWS. As described in these docs I created a SAML provider and the role for SAML access in AWS IAM.
Now I try to configure Gluu. Because the SAML engine in Gluu is Shibboleth I use docs about configuring Shibboleth with AWS. For exampl:
- [http://d0.awsstatic.com/whitepapers/aws-whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth.pdf](http://d0.awsstatic.com/whitepapers/aws-whitepaper-single-sign-on-integrating-aws-open-ldap-and-shibboleth.pdf)
- [https://community.jisc.ac.uk/system/files/222/experiences-aws-shibboleth.pdf](https://community.jisc.ac.uk/system/files/222/experiences-aws-shibboleth.pdf)
- [https://community.jisc.ac.uk/system/files/1654/AWS-Shib%20%28v1.0%29.pdf](https://community.jisc.ac.uk/system/files/1654/AWS-Shib%20%28v1.0%29.pdf)
Using these docs and Gluu docs I created Trust Relationship for AWS by Gluu Configuration GUI. Also I created custom Attribute (that is named awsRoles) by Gluu Configuration GUI and configure it to be as Realesed Attribute with previously created Relationship.
Also I tried to assign the value for this attribute by changing of _/opt/apache-tomcat-7.0.65/conf/shibboleth2/idp/attribute-resolver.xml.vm_ where I added the following lines:
```
#if( ! ($attribute.name.equals('transientId') or $attribute.name.equals('awsRoles') )
...
<resolver:AttributeDefinition id="awsRoles" xsi:type="ad:Mapped" sourceAttributeID="mail">
<resolver:Dependency ref="siteLDAP"></resolver:Dependency>
<resolver:AttributeEncoder xsi:type="enc:SAML2String" name="https://aws.amazon.com/SAML/Attributes/Role" friendlyName="Role" ></resolver:AttributeEncoder>
<ad:ValueMap>
<ad:ReturnValue>arn:aws:iam::XXXXXXXXXXXX:saml-provider/myGluu,arn:aws:iam::XXXXXXXXXXXX:role/RoleForMyGluuUsers</ad:ReturnValue>
<ad:SourceValue>cn=AWS ([^,]*),.*</ad:SourceValue>
</ad:ValueMap>
</resolver:AttributeDefinition>
```
XXXXXXXXXXXX is replaced by my AWS ID. I used mail as source of value and I'm not sure that it is correct. But the value is hardcoded and I think that source value is unnecessary.
And I try to use the URL like this
_https://MyIdP/idp/profile/SAML2/Unsolicited/SSO?providerId=urn:amazon:webservices_ but I see error message from AWS: _**Error: Your request included an invalid SAML response.**_
Error messages are described here [http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_saml.html](http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_saml.html)
Using Browser's SAML Tools I captured SAML assertions from my Gluu and I don't see Subjects with awsRoles.