I made a role and by using this commend
aws sts assume-role --role-arn arn:aws:iam::xxxxxxxxxxxxrole/rolename --role-session-name s3sdawx
i got credentials After obtaining temporary credentials with the command I accessed s3 with these credentials!
by the way Token expires after 1 hour. So, as shown in the picture, I changed the maximum session duration to 12 hours, got the temporary credentials through the above command again and tried to apply it again, but it still expires after 1 hour! I wonder what method should be used to extend it to 12 hours!