<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cognito as IdP provider for Delta Share in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cognito-as-idp-provider-for-delta-share/m-p/127394#M47948</link>
    <description>&lt;P&gt;We managed to figure how to make machine to machine authentication to work.&lt;BR /&gt;when you setup cognito pool for m2m scenario you add App Client&lt;BR /&gt;and then set App Client as both `sub` and Audience in databricks recepient OIDC Policy:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pogo_0-1754351423709.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18725iF12DAC6E09E4C403/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pogo_0-1754351423709.png" alt="pogo_0-1754351423709.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Set `aud` claim to the app client_id in cognito generated access token using a `pre token generation` lambda (cognito pool -&amp;gt; extensions -&amp;gt; Lambda Triggers -&amp;gt; Authentication -&amp;gt; Pre token generation -&amp;gt; select v3 event type)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def lambda_handler(event, context):
    if event['triggerSource'] == "TokenGeneration_ClientCredentials":
        # Override the 'aud' claim
        print("overriding aud claim")
        event['response'] = {
            "claimsAndScopeOverrideDetails": {
                "accessTokenGeneration": {
                    "claimsToAddOrOverride": {
                        "aud": "54m...."
                    }
                }
            }
        }
    
    # Return to Amazon Cognito
    return event&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Aug 2025 23:56:18 GMT</pubDate>
    <dc:creator>pogo</dc:creator>
    <dc:date>2025-08-04T23:56:18Z</dc:date>
    <item>
      <title>Cognito as IdP provider for Delta Share</title>
      <link>https://community.databricks.com/t5/data-engineering/cognito-as-idp-provider-for-delta-share/m-p/127385#M47943</link>
      <description>&lt;P&gt;I am trying to setup a delta sharing Recipient using OIDC Federation with the Issuer URL being cognito idp endpoint.&lt;/P&gt;&lt;P&gt;Are there any examples, other than EntraID, for the values of Subject Claim/Subject/Audiences in the OIDC Policy for Cognito or Google?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 21:30:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cognito-as-idp-provider-for-delta-share/m-p/127385#M47943</guid>
      <dc:creator>pogo</dc:creator>
      <dc:date>2025-08-04T21:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cognito as IdP provider for Delta Share</title>
      <link>https://community.databricks.com/t5/data-engineering/cognito-as-idp-provider-for-delta-share/m-p/127394#M47948</link>
      <description>&lt;P&gt;We managed to figure how to make machine to machine authentication to work.&lt;BR /&gt;when you setup cognito pool for m2m scenario you add App Client&lt;BR /&gt;and then set App Client as both `sub` and Audience in databricks recepient OIDC Policy:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pogo_0-1754351423709.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/18725iF12DAC6E09E4C403/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pogo_0-1754351423709.png" alt="pogo_0-1754351423709.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Set `aud` claim to the app client_id in cognito generated access token using a `pre token generation` lambda (cognito pool -&amp;gt; extensions -&amp;gt; Lambda Triggers -&amp;gt; Authentication -&amp;gt; Pre token generation -&amp;gt; select v3 event type)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def lambda_handler(event, context):
    if event['triggerSource'] == "TokenGeneration_ClientCredentials":
        # Override the 'aud' claim
        print("overriding aud claim")
        event['response'] = {
            "claimsAndScopeOverrideDetails": {
                "accessTokenGeneration": {
                    "claimsToAddOrOverride": {
                        "aud": "54m...."
                    }
                }
            }
        }
    
    # Return to Amazon Cognito
    return event&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 23:56:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cognito-as-idp-provider-for-delta-share/m-p/127394#M47948</guid>
      <dc:creator>pogo</dc:creator>
      <dc:date>2025-08-04T23:56:18Z</dc:date>
    </item>
  </channel>
</rss>

