Solved

Is there a way to get the authentication token in the custom app?

  • 24 June 2021
  • 5 replies
  • 85 views

Userlevel 7
Badge +6

I found the following in the code of the calendar app:

 

 

There seems to be a function

pipefy.getAuthToken()

on the pipefyApp object as also used for registering any pipe badges etc.

Unfortunately, when I use this function, it only returns false. Why is this? What can I do to get the authentication token in the custom app?

icon

Best answer by amadeu-cavalcante 22 September 2021, 17:00

View original

5 replies

Userlevel 1

hi @genietim 

 

Are you trying to create a new custom app? Can you give more context? If you are planning to use the GraphQL API, I would recommend you to create a new token here https://app.pipefy.com/tokens

Userlevel 7
Badge +6

HI @amadeu-cavalcante, I am sorry to see your answer only now. Yes, I am trying to create a custom app (well, I already did actually). The problem I was/am struggling with is the users’ tokens. Yes, I know how to create the tokens and I can use the Pipefy GraphQL API with them. BUT: I do not want to ship the tokens to the user in the custom app. My current workaround is to have the token in the backend and use the backend as a proxy for the queries. But again, while this works for now, it is not ideal: this makes all queries be run by the one token I have, meaning only one user. Other users using the custom app do their mutations with my user. I could ask each and every user to go to https://app.pipefy.com/tokens and give me their token, but this would not be future-proof nor a good user experience. Especially knowing that there is a way without.

 

If I could get the users’ token (as the calendar custom app does, for example), this would remove the need for the proxy as well as solve the issue with the “only one” user making queries.

 

Or am I misunderstanding your suggestion?

Userlevel 1

@genietim Sorry for taking so long to reply to you.

 

I was searching if we could current support what you are asking. And, unfortunately, the  `getAuthToken` method used by our calendar app was designed to internal usage only. 

 

I'll keep you posted as soon as we have any solution for your problem. I'm really sorry.

Userlevel 7
Badge +6

@genietim did you get the answer you are looking for?

Userlevel 7
Badge +6

@Juliana Spinardi well, maybe not the one I had hoped for, but “internal usage only” is an answer, I just marked it as such, though I hope @amadeu-cavalcante will have the possiblitiy to come back some time with a more positive answer (:

Reply