Is Using External Events to Return Data Reliable?

Hi Everyone,

I’m exploring whether it’s reliable to use external events to return data and wanted to get your thoughts.

My case:
I need to pass the OAuth token to a modal for authentication purposes. Unfortunately, I can’t directly fetch the OAuth token in the code, as it’s only available for use in requests.

To work around this, I considered using middleware to extract the token from the header and pass it back to the app, embedding it in the modal. I tested this approach by utilizing an external app to retrieve the token from the header and return it via the RenderData method.

My question:
Is this approach reliable, or are there better alternatives I should consider?

Thank you for your insights!

@Freddy

your thoughts on this?