Microsoft authentication time out error

im using microsoft authentication node, in which im using username & password authentication option. After running my work flow which is quite big ; i getting “Execute failed: Access token has expired or is not yet valid”. i need to reset the node to execute the flow again. please advise me a suitable solution

Hi @JONAM10 and welcome to the Knime Community.

The mistake that most users do is to establish the connection too early (most of the time they establish it right at the beginning of the workflow). When it’s established too early, it can expire by the time it’s really needed.

Connections should be established right before it’s needed, that is after you have finished doing your data processing. You can control this by connecting the nodes via the Flow Variable ports.

If you can show us your workflow, we can point you how to do this.

2 Likes

thank you for your suggestion. please note that i m reading the files from SharePoint and then carry out data cleaning and processing.
please find below screen shot of the workflow.


appreciate if you could show how to connect the node via flow variable port.

Hi @JONAM10 , if it helps you, you can display the Flow Variable ports. Just right-click on the node, and then click on “Show Flow Variable Ports”:
image

You will then see the Flow Variable Connectors like this:
image

In your case, it looks like you may need to initiate another SharePoint connection, because you do need the current SharePoint Connection at the beginning. The problem is that your metanode “initial_clean_up_for…” might take long and by the time you reach next metanode, your connection might be over (Your screenshot is soo small, it’s hard to read it).

So, you might want to add another connection dedicated for the 2nd metanode. However, you need to make sure that the dedicated connection starts only after the “initial_clean_up_for…” metanode, and that’s there you would connect that metanode to the connection.

Similarly, your MongoDB Connector should execute only before the MongoDB Writer. To do this, you can simply connection the JSON Transformer node to the MondoDB Connector like this:
image

That way, the MondoDB Connection will initiate only after the JSON Transformer node has completed. As it stands right now, this MongoDB Connection will initiate as soon as the workflow starts.

2 Likes

thank you for suggestion. i had split the workflow into 2 and introduced authentication as variable option it works .

1 Like

No problem @JONAM10 , happy to help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.