Login to external URL using tokens with post method

Hi, is there a way to use the sytem.perspective.navigate but with a Header included to navigate to a website? My situation is I need a button to redirect user to a URL, but the URL requires a token in the header to authenticate. If I just use the URL it gives me

"detail": "Authentication credentials were not provided."
image

But if I use the sytem.net.httpPost function, it returns the webpage's HTML as string and doesn't open a new page.

Anybody had to do something like this before?

Cheers

No, this isn't possible. We perform a direct navigate to the new page, equivalent to a GET request, with no additional headers attached.

Actually, on further thought, I'm pretty sure this is impossible in general. The only way web browsers support passing context to a new page is a form submission from the first page, as far as I know.

Hi @PGriffith , thanks for coming to my rescue again :smiley:

I'm not familiar with token authentications, I assumed this url uses POST because having the token readable in GET request is a security risk.

So using a button to auto authenticate is impossible in ignition?

I think I have seen codes in ajax functions in JS that uses POST to send login credentials to the new page to perform a seamless login experience.

I can use the button to redirect the user to the login URL of this 3rd party website instead, and they log in manually, but that ruins the seamless experience I was aiming for :sweat_smile: