@@ -368,3 +368,43 @@ type CognitoEventUserPoolsCustomMessageResponse struct {
368368 EmailMessage string `json:"emailMessage"`
369369 EmailSubject string `json:"emailSubject"`
370370}
371+
372+ // CognitoFederationProviderType is the type of the external identity provider.
373+ type CognitoFederationProviderType string
374+
375+ const (
376+ CognitoFederationProviderTypeOIDC CognitoFederationProviderType = "OIDC"
377+ CognitoFederationProviderTypeSAML CognitoFederationProviderType = "SAML"
378+ CognitoFederationProviderTypeFacebook CognitoFederationProviderType = "Facebook"
379+ CognitoFederationProviderTypeGoogle CognitoFederationProviderType = "Google"
380+ CognitoFederationProviderTypeSignInWithApple CognitoFederationProviderType = "SignInWithApple"
381+ CognitoFederationProviderTypeLoginWithAmazon CognitoFederationProviderType = "LoginWithAmazon"
382+ )
383+
384+ // CognitoEventUserPoolsInboundFederation is sent by Amazon Cognito User Pools when a user signs in
385+ // through a third-party identity provider, allowing a Lambda to inspect and transform federated user attributes.
386+ type CognitoEventUserPoolsInboundFederation struct {
387+ CognitoEventUserPoolsHeader
388+ Request CognitoEventUserPoolsInboundFederationRequest `json:"request"`
389+ Response CognitoEventUserPoolsInboundFederationResponse `json:"response"`
390+ }
391+
392+ // CognitoEventUserPoolsInboundFederationRequest contains the request portion of an InboundFederation event
393+ type CognitoEventUserPoolsInboundFederationRequest struct {
394+ ProviderName string `json:"providerName"`
395+ ProviderType CognitoFederationProviderType `json:"providerType"`
396+ Attributes CognitoEventUserPoolsInboundFederationAttributes `json:"attributes"`
397+ }
398+
399+ // CognitoEventUserPoolsInboundFederationAttributes contains the identity provider attributes
400+ type CognitoEventUserPoolsInboundFederationAttributes struct {
401+ TokenResponse map [string ]string `json:"tokenResponse,omitempty"`
402+ IDToken map [string ]string `json:"idToken,omitempty"`
403+ UserInfo map [string ]string `json:"userInfo,omitempty"`
404+ SAMLResponse map [string ]string `json:"samlResponse,omitempty"`
405+ }
406+
407+ // CognitoEventUserPoolsInboundFederationResponse contains the response portion of an InboundFederation event
408+ type CognitoEventUserPoolsInboundFederationResponse struct {
409+ UserAttributesToMap map [string ]string `json:"userAttributesToMap"`
410+ }
0 commit comments