Skip to content

Commit

Permalink
Add correct partition for get_federation_token response
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl committed Jun 14, 2024
1 parent 5acba3a commit 4d66792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moto/sts/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_federation_token(self) -> str:
name = self.querystring.get("Name")[0] # type: ignore
token = self.backend.get_federation_token(duration=duration, name=name)
template = self.response_template(GET_FEDERATION_TOKEN_RESPONSE)
return template.render(token=token, account_id=self.current_account)
return template.render(token=token, account_id=self.current_account, partition=self.partition)

def assume_role(self) -> str:
role_session_name = self.querystring.get("RoleSessionName")[0] # type: ignore
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_caller_identity(self) -> str:
<AccessKeyId>AKIAIOSFODNN7EXAMPLE</AccessKeyId>
</Credentials>
<FederatedUser>
<Arn>arn:aws:sts::{{ account_id }}:federated-user/{{ token.name }}</Arn>
<Arn>arn:{{ partition }}:sts::{{ account_id }}:federated-user/{{ token.name }}</Arn>
<FederatedUserId>{{ account_id }}:{{ token.name }}</FederatedUserId>
</FederatedUser>
<PackedPolicySize>6</PackedPolicySize>
Expand Down

0 comments on commit 4d66792

Please sign in to comment.