There are more AWS SDK examples available in the AWS Doc SDK Examples
List inline IAM policies for a user using an AWS SDK
The following code example shows how to list inline IAM policies for a user.
To avoid security risks, don't use IAM users for authentication when developing purpose-built software or working with real data. Instead, use federation with an identity provider such as AWS IAM Identity Center (successor to AWS Single Sign-On).