Invalid Token error when using the signed_pdf_url value in an iFrame

  • 1
  • Question
  • Updated 4 days ago
We use an iframe in our application to allow our users to see their signed documents within our application.  When we try to display the signed_pdf_url returned from the GET /documents/{id} request we receive the following error:

InvalidTokenThe provided token is malformed or otherwise Invalid.<aws token>
Photo of Michael Roscher

Michael Roscher

  • 13 Posts
  • 1 Reply Like
  • frustrated

Posted 2 weeks ago

  • 1
Photo of Imagine Atom

Imagine Atom

  • 13 Posts
  • 1 Reply Like
Hi Michael

Are you making a new request every time you need to get the signed PDF? We had the same issue and the solution that worked for us is to get a fresh signed_pdf_url. The AWS access token is present in that URL's parameters and it expires in a matter of hours which is very inconvenient. However if you make a request to GET /documents/{id} the moment you want to retrieve the signed PDF URL you will get a fresh URL.
Also, I don't believe you can display the PDF because AWS sets the Content Disposition for that PDF url request as attachment meaning it is to be downloaded and not displayed. So you iframe implementation may not work as you might expect. However if you find a way to do that I would love to hear from you.

(Edited)
Photo of Michael Roscher

Michael Roscher

  • 13 Posts
  • 1 Reply Like
Hi Atom,

Yes, the application is making a new request to GET /documents/{id} each time the user requests to view the document.  I can see the aws_token changing each time we make a request to GET /documents/{id}.  If the document is unsigned then we want to display the recipients sign_url value.  If the document is signed then we want to display the signed_pdf_url.  

I know that in R3 we are able to display the document in an iFrame.  Is this no longer supported in R4?  Is there a different workflow to achieve this?  Can anyone from the RightSignature dev team respond please?
Photo of Michael Roscher

Michael Roscher

  • 13 Posts
  • 1 Reply Like
UPDATE:  I was able to display an unsigned document in our application's iframe and was able to successfully sign it through the iframe.  Therefore, there is some issue with displaying the PDF version of the document in the iframe or even being allowed to download it.
Photo of Priyanka Mehta

Priyanka Mehta

  • 6 Posts
  • 0 Reply Likes
I have the same issue. Were you able to find a solution?
Photo of Michael Roscher

Michael Roscher

  • 13 Posts
  • 1 Reply Like
No, I have not been able to find a solution.  Is there anyone from the RightSignature dev team that can respond to this thread?