Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Fetch Token from MicrosoftOnline API(OAuth 2.0)

avatar
New Contributor

Hi All,

I hope you are doing well. Please help me with below request.

Currenty our client is using MS Dynamics and they gave basic details required to fetch token.

In Postman - 1. I'm choosing OAuth 2.0 in Authorization.
                     2. Giving the basic details(shared below) it asked for.
                     3. Then clicking on "Get New Access Token"
                     4. New window pops up to enter my Username and Password.
                     5. Post validating Creds, it gives the Token in another window.

Problem : All the steps which I'm doing in postman, I want to implement the same in Apache Nifi(to fetch the Token). Basically I need an API along with a request payload to fetch the token.(I'm worried if it is possible to do so in one call, as we need to give User Creds too).

Basic Details -
Token Name - MyToken
Grant Type - implicit
Callback URL - https://callbackUrl
Auth URL - https://login.microsoftonline.com/common/oauth2/authorise?resource=https://company007.crm5.dynamic.c...
Client ID - d9cdd9f1-3fjdf45-005jl-9e5b-1bb87-4jdfhn

AidenMartin_0-1716800999181.png

 



1 REPLY 1

avatar
New Contributor

@AidenMartin wrote:

Hi All,

I hope you are doing well. Please help me with below request.

Currenty our client is using MS Dynamics and they gave basic details required to fetch token.

In Postman - 1. I'm choosing OAuth 2.0 in Authorization.
                     2. Giving the basic details(shared below) it asked for.
                     3. Then clicking on "Get New Access Token"
                     4. New window pops up to enter my Username and Password.
                     5. Post validating Creds, it gives the Token in another window.

Problem : All the steps which I'm doing in postman, I want to implement the same in Apache Nifi(to fetch the Token). Basically I need an API along with a request payload to fetch the token.(I'm worried if it is possible to do so in one call, as we need to give User Creds too).

Basic Details -
Token Name - MyToken
Grant Type - implicit
Callback URL - https://callbackUrl
Auth URL - https://login.microsoftonline.com/common/floridablue/oauth2/authorise?resource=https://company007.crm5.dynamic.com/
Client ID - d9cdd9f1-3fjdf45-005jl-9e5b-1bb87-4jdfhn

AidenMartin_0-1716800999181.png

 




Hello, @AidenMartin 

 

Certainly! To automate the OAuth 2.0 token retrieval in Apache NiFi, you can:

Use the InvokeHTTP processor to request the token.
Extract the token with EvaluateJsonPath.
Store and use the token in subsequent requests.

 

 

I hope this is helpful to you.

 

Best Regard,
Diana Hill