302 Error when trying to naviagte through app proxy service

Zarwalski, Lily 20 Reputation points
2024-05-10T13:53:23.2933333+00:00

hi there,

I am trying to access a json that is sat behind an app proxy. i want to do this via power automate

If i do the initial request directly to the api, i get a 302 error redirecting me to login. which then terminates the flow.

I updated the endpoint and changed it to micosoft directly and managed to login and get an access token.

However when i then use the access token to do the get request, it still redirects with the reason of invalid token.
User's image

any help, greatly appreciateimage

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,953 questions
{count} votes

Accepted answer
  1. Navya 4,860 Reputation points Microsoft Vendor
    2024-05-17T11:44:12.9333333+00:00

    Hi @Zarwalski, Lily

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    Trying to access a JSON file that is behind an app proxy using Power Automate. However, when they try to access the API directly, they receive a 302-error redirecting them to login, which terminates the flow.

    Solution:

    To fix this issue please follow below steps:

    1. Build a custom connector in power Automate and direct it to the proxy
    2. make sure proxy is on same tenant as power automate. despite the tenant being set, it didn't work when the proxy was on a different tenant, worked after moving it
    3. if your api is not Azure AD log in but is oauth, you might need to do the work around we did and tell the api to look at a different header for authorization. You can't set authorization header in custom connector, so we passed an access-token header and got the API to swap this to auth header when it received the request.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    I hope this helps! Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Zarwalski, Lily 20 Reputation points
    2024-05-17T11:19:19.4766667+00:00

    In Case Anyone else encounters the issue.

    Steps done to resolve.

    1. Build a custom connector in power Automate and direct it to the proxy
    2. make sure proxy is on same tenant as power automate. despite the tenant being set, it didn't work when the proxy was on a different tenant, worked after moving it
    3. if your api is not Azure AD log in but is oauth, you might need to do the work around we did and tell the api to look at a different header for authorization. You can't set authorization header in custom connector, so we passed an access-token header and got the API to swap this to auth header when it received the request.

    Hope this helps anyone else who stumbles across this down the line

    0 comments No comments