To get the temporary session token use the following command:
aws sts get-session-token --token-code <value>
To use these security credentials with AWS CLI, follow the commands:
aws sts assume-role --role-arn arn:aws:iam::123456789012:role/role-name --role-session-name "RoleSession1" --profile IAM-user-name > assume-role-output.txt
Keep Learning :)