01-08-2020 11:12 AM
A simple button (manual) flow that can parse a bearer token to extract details like:
Note that a HTTP based flow won't execute when you pass a bearer token in the Authorization header. You can send it as a normal POST body or a parameter instead and use that as a layer of security so that Flow can validate the token and only then execute.
Hi, I incorporated this in one of my flows to extract, decode, and parse a JWT and it works great, however I encounter an error with certain JWT values. After decodeBase64, I get an Unexpected character at the end of the nbf claim, so the ParseJSON action produces an error:
The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value cannot be parsed: 'Unexpected character encountered while parsing number: �. Path 'nbf', line 1, position 426.'.
The output of decodeBase64() is as follows, and it doesn't have a closing brace:
In other cases, it works fine. Any idea what could be wrong? Thanks.
Figured it out - decodeBase64() expects the input's length to be divisible by 4, so as a workaround, I just appended (one or more) '=' characters to my token before decoding. Works ok now.
Hi @svarukala , I was trying to follow your steps, the decode does not work for the token i generated using Oauth2. Can you help me with that
Unfortunately, i will not able to share the token value here. I can PM you if you can help me with fix the decode
i have used your flow and i have an error:
Unable to process template language expressions in action 'decode_bearer' inputs at line '1' and column '3440': 'The template language function 'decodeBase64' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.