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??
@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 .
@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?
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
@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
@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 ?
@rakadakaka Could you please tell me how can I regenerate new Token in Flow?? which API or connector i should Use?
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 .