title: Why are Cognito custom attributes not received in Lambda
body: <p>I am using a "Cognito User Pool authorizer" (no "AWS_IAM" option, no custom coded authorizer) to call Lambda methods as HTTPS via API Gateway.</p>
  
  <p>On Lambda, I set a custom user attribute <code>custom:partnerId</code> via <code>adminUpdateUserAttributes</code> under some circumstances. </p>
  
  <p>I can verify that it has been set correctly via the Cognito User Pools AWS console. </p>
  
  <p>On the iOS client, I can also successfully get all user attributes (including the custom one) as described in my answer at <a href="https://stackoverflow.com/questions/43144135/how-to-get-cognito-user-pool-sub-attribute-on-ios">How to get Cognito user pool &quot;sub&quot; attribute on iOS</a> </p>
  
  <p>The problem is this:</p>
  
  <p><strong>I do not receive this custom attribute in Lambda</strong> as
  <code>event.requestContext.authorizer.claims['custom:partnerId']</code> with the next API requests</p>
  
  <p><strong>until I force the user to sign in explicitly again</strong> (with username/password) on the iOS client.</p>
  
  <p>After this explicit sign in, I then receive the custom attribute included in the <code>authorizer.claims</code> parameters as expected.</p>
  
  <p>I don't know whether this is a API Gateway problem (since I assume it is fetching the Cognito user via the HTTP "Authorization" header), a problem with the iOS Cognito SDK, or a problem with Lambda itself.</p>