Testing for AWS credentials is a straightforward operation.
There is a single API call that will always work regardless of permissions: GetCallerIdentity
Arn value depends on the type of credentials, but mostly includes the human-friendly name.
In addition, checking the status is reliable:
0 for success,
255 for failure.