<?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>question Re: NiFi  API OAuth authentication issue in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/405222#M252434</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124799"&gt;@RaoNEY&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 15:47:18 GMT</pubDate>
    <dc:creator>DianaTorres</dc:creator>
    <dc:date>2025-04-01T15:47:18Z</dc:date>
    <item>
      <title>NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404453#M252325</link>
      <description>&lt;P&gt;We need help to get token to execute Apache NiFi API which is running on Linux and OAuth authentication.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The below two steps we have taken.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get token from Microsoft OAuth API call which gives us the token. &amp;lt;Success&amp;gt;&lt;/LI&gt;&lt;LI&gt;Using the token above and we are trying to get token from NiFi Api call which is not success&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Token from Azure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X POST &lt;A href="https://login.microsoftonline.com/%7btenant%7d/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token&lt;/A&gt; \&lt;/P&gt;&lt;P&gt;&amp;nbsp; -H "Content-Type: application/x-www-form-urlencoded" \&lt;/P&gt;&lt;P&gt;&amp;nbsp; -d "grant_type=client_credentials" \&lt;/P&gt;&lt;P&gt;&amp;nbsp; -d "client_id={CliendID}" \&lt;/P&gt;&lt;P&gt;&amp;nbsp; -d "client_secret={ClientSecret}" \&lt;/P&gt;&lt;P&gt;&amp;nbsp; -d "scope={CliendID}/.default"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result: Generated successful "{token}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl -X POST &lt;A href="https://NIFIDnsName:9444/nifi-api/access/oidc/exchange" target="_blank" rel="noopener"&gt;https://NIFIDnsName:9444/nifi-api/access/oidc/exchange&lt;/A&gt; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -H "Authorization: Bearer {token}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;Unauthorized error="invalid_token", error_description="An error occurred while attempting to decode the Jwt: Signed JWT rejected: Another algorithm exp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nifi.properties file:&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.discovery.url=&lt;A href="https://login.microsoftonline.com/{tanent}/v2.0/.well-known/openid-configuration" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tanent}/v2.0/.well-known/openid-configuration&lt;/A&gt;&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.connect.timeout=5 secs&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.read.timeout=5 secs&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.client.id=*********************&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.client.secret=**********************&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.preferred.jwsalgorithm=RS256&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.additional.scopes=offline_access&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.claim.identifying.user=email&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.fallback.claims.identifying.user=&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.claim.groups=groups&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.truststore.strategy=JDK&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.token.refresh.window=60 secs&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.pkce.enabled=true&lt;/P&gt;&lt;P&gt;nifi.security.user.oidc.jwt.algorithm=RS256&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help us steps to execute simple NiFi API call which is running OAuth authentication.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 21:51:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404453#M252325</guid>
      <dc:creator>RaoNEY</dc:creator>
      <dc:date>2025-03-19T21:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404454#M252326</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124799"&gt;@RaoNEY&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 23:38:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404454#M252326</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-03-19T23:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404530#M252335</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124799"&gt;@RaoNEY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;The error message suggests that there's a JWT token algorithm mismatch: &lt;EM&gt;"&lt;FONT color="#FF6600"&gt;An error occurred while attempting to decode the Jwt: Signed JWT rejected: Another algorithm exp"&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;This typically happens when:&lt;/P&gt;&lt;OL class=""&gt;&lt;LI&gt;The token you're receiving from Azure in Step 1 uses a signing algorithm that doesn't match what NiFi is expecting&lt;/LI&gt;&lt;LI&gt;NiFi is configured to use RS256 algorithm (as shown in your nifi.properties), but the Azure token might be using a different algorithm&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Verify token algorithm&lt;/STRONG&gt;&lt;BR /&gt;First, check what algorithm your Azure token is using. You can decode your JWT token using tools like &lt;A class="underline" href="https://jwt.io/" target="_blank" rel="noopener"&gt;jwt.io&lt;/A&gt; to see the header which contains the algorithm (look for the "alg" field).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modify your Azure token request&lt;BR /&gt;&lt;/STRONG&gt;Azure AD OAuth tokens typically use RS256, but you may need to specify this explicitly in your Azure app registration settings.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ensure correct token type&lt;BR /&gt;&lt;/STRONG&gt;For NiFi OAuth/OIDC authentication, you need an ID token, not an access token. In your Step 1, you're requesting a client credentials grant which returns an access token. Instead, you need to:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;SPAN class=""&gt;# Modified Step 1 - Use authorization code flow to get ID token&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;curl -X POST &lt;A href="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token&lt;/A&gt; \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-H "Content-Type: application/x-www-form-urlencoded" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "grant_type=authorization_code" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "client_id={ClientID}" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "client_secret={ClientSecret}" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "code={AuthorizationCode}" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "redirect_uri={RedirectURI}" \&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;-d "scope=openid email profile&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;STRONG&gt;Update NiFi properties&lt;/STRONG&gt;: Ensure these settings match your Azure configuration:&lt;/P&gt;&lt;DIV class="relative flex flex-col rounded-lg"&gt;&lt;DIV class="text-text-300 absolute pl-3 pt-2.5 text-xs"&gt;&lt;LI-SPOILER&gt;# Make sure these settings are correct&lt;BR /&gt;nifi.security.user.oidc.jwt.algorithm=RS256&lt;BR /&gt;nifi.security.user.oidc.preferred.jwsalgorithm=RS256&lt;/LI-SPOILER&gt;&lt;/DIV&gt;&lt;DIV class="pointer-events-none sticky my-0.5 ml-0.5 flex items-center justify-end px-1.5 py-1 mix-blend-luminosity top-0"&gt;&lt;DIV class="from-bg-300/90 to-bg-300/70 pointer-events-auto rounded-md bg-gradient-to-b p-0.5 backdrop-blur-md"&gt;&lt;STRONG&gt;Check Azure app registration&lt;BR /&gt;&lt;/STRONG&gt;In your Azure portal, verify:&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Redirect URI is properly set to your NiFi callback URL&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;The app has appropriate API permissions&lt;/LI&gt;&lt;LI&gt;Token configuration includes ID tokens&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Complete Authentication Flow&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class="whitespace-pre-wrap break-words"&gt;For NiFi OAuth with Azure AD, the proper flow should be:&lt;/P&gt;&lt;P&gt;1. Initiate login via NiFi UI or using&lt;/P&gt;&lt;LI-SPOILER&gt;GET &lt;A href="https://NIFIDnsName:9444/nifi-api/access/oidc/request" target="_blank" rel="noopener"&gt;https://NIFIDnsName:9444/nifi-api/access/oidc/request&lt;/A&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;2. This redirects to Microsoft login page, where user authenticates&lt;/P&gt;&lt;P&gt;3. After successful authentication, Azure redirects back to NiFi with an authorization code&lt;/P&gt;&lt;P&gt;4. NiFi exchanges this code for tokens automatically&lt;/P&gt;&lt;P&gt;5. If you're doing this programmatically, use the authorization code flow, not client credentials&lt;BR /&gt;The direct token exchange you're attempting in Step 2 might not be supported or requires specific configuration. NiFi typically handles the OIDC token exchange internally after receiving the authorization code.&lt;BR /&gt;The direct token exchange you're attempting in Step 2 might not be supported or requires specific configuration. NiFi typically handles the OIDC token exchange internally after receiving the authorization code.&lt;BR /&gt;&lt;BR /&gt;happy hadooping&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 20:48:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/404530#M252335</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2025-03-20T20:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/405222#M252434</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/124799"&gt;@RaoNEY&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 15:47:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/405222#M252434</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-04-01T15:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/406381#M252533</link>
      <description>&lt;P&gt;How do we get&amp;nbsp;&lt;SPAN&gt;AuthorizationCode for step one. Can you please provide curl commands&amp;nbsp; to get token to use Nifi api calls&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 21:59:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/406381#M252533</guid>
      <dc:creator>RaoNEY</dc:creator>
      <dc:date>2025-04-15T21:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/412051#M253219</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We're in the same situation and wanted to add that, based on this ticket: &lt;A class="" href="https://issues.apache.org/jira/browse/NIFI-5302" target="_new" rel="noopener"&gt;https://issues.apache.org/jira/browse/NIFI-5302&lt;/A&gt;, support for the Client Credentials Flow with OIDC access tokens should be available. However, it's unclear how this is supposed to be implemented, and we’re not sure which endpoint the Azure token should be sent to.&lt;/P&gt;&lt;P&gt;Similarly, for the Authorization Code Flow, it's also not clear which endpoint should be accessed after obtaining the token from Azure.&lt;/P&gt;&lt;P&gt;Could we please get some clear, step-by-step guidance on how to configure and use these flows?&lt;/P&gt;&lt;P&gt;Thank you!&lt;BR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/93628"&gt;@DianaTorres&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/20288"&gt;@Shelton&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 15:16:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/412051#M253219</guid>
      <dc:creator>VVPeter</dc:creator>
      <dc:date>2025-08-06T15:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi  API OAuth authentication issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/412064#M253231</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38301"&gt;@mburgess&lt;/a&gt;&amp;nbsp;Hi! Do you have any insights here? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 23:06:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-API-OAuth-authentication-issue/m-p/412064#M253231</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2025-08-08T23:06:10Z</dc:date>
    </item>
  </channel>
</rss>

