Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

getting Data with Bearer token

(0) ShareShare
ReportReport
Posted on by

I am calling this api through http connector. But it gives me 401.

 

It needs an authentication bearer token But I cant hardcode this value in flow since it will expire after sometime mostly 24 hours.

 

How can i  make it work??

 

https://extensionanalyzer.azure-test.net/api/extensiondeploymentsinfo?extensionName=Microsoft_Azure_DataProtection

  • rakadakaka Profile Picture
    rakadakaka 77 on at
    Re: getting Data with Bearer token

    @adigupt  : Please reach out to tenant Administrator(AAD Administrator) and ask them to create a new client secret and provide it you . Which you can use for authentication .

     

    You can provide them client ID , for that particular client , Administrator can generate a new client secret and share with you .

  • adigupt Profile Picture
    adigupt on at
    Re: getting Data with Bearer token

    @rakadakaka  but the problem is that this token api needs 3 things, tenantid, clientid & client_secret . I have tenantid and clientid but dont know client_secret. Also I  dont have access to this APP So I am not able to find client_secret. Do you know how can we get client_secret from clientid?

  • rakadakaka Profile Picture
    rakadakaka 77 on at
    Re: getting Data with Bearer token

    Thanks @adigupt for clarifying . So, to get the token again you can call the same token end point again , no need to store the token every time regenerate a new token .

     

    https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/token

     

    Please let me know if further help is need on this topic .

     

    If this helps , please accept it as solution , so it will help others in the community

     

  • adigupt Profile Picture
    adigupt on at
    Re: getting Data with Bearer token

    @rakadakaka  I am using AAD auth based authorization to get the bearer token.

     

    The Url is 

    https://login.microsoftonline.com/<tenantid>/oauth2/v2.0/token

     

     

  • rakadakaka Profile Picture
    rakadakaka 77 on at
    Re: getting Data with Bearer token

    @adigupt  :

     

    How are you getting authentication token 1st time ? You would be using some token endpoint to get the token .

     

    You can call the same token endpoint everytime you want to connect to the endpoint (extension analyzer endpoint) , No need to store the token anywhere .

     

    Again based on the limited information , you have provided in the post , this is what I can deduce .

     

    1. Resource which you are trying to connect :  https://extensionanalyzer.azure-test.net/api/extensiondeploymentsinfo?extensionName=Microsoft_Azure_DataProtection

     

    2. Resource server : https://extensionanaluzer.azure-test.net/

     

    3. Assuming you are using AAD as the IAM [Authorization Server] to get the token via a registered App on AAD .

     

    4.  If you are using AAD based on assumption from step 3 , you can call the AAD token endpoint for your token and get the token which you can pass as Bearer token in your API call .

     

    AAD Token endpoint URL

     https://login.microsoftonline.com/<<TenantID>>/oauth2/v2.0/token

     

    Step 3 and 4 are based on assumption . If you can tell which Authorization server is being used I can help further or how are you getting the 1st token which is valid for 24 hours ?

  • adigupt Profile Picture
    adigupt on at
    Re: getting Data with Bearer token

    @rakadakaka Could you please tell me how can I regenerate new Token in Flow?? which API or connector i should Use?

  • rakadakaka Profile Picture
    rakadakaka 77 on at
    Re: getting Data with Bearer token

    If the end point which you are calling has no restriction on how many times the token generation endpoint can be called . My suggestion will be to regenerate the token every time you want to connect to the service and use the token in the endpoint call .

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics