Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Missing authentication token #16

Closed
Bechrissed opened this issue May 30, 2019 · 10 comments
Closed

Missing authentication token #16

Bechrissed opened this issue May 30, 2019 · 10 comments

Comments

@Bechrissed
Copy link

Hi,

I've been setting up formplug for the second time. The first time was for my own website running on my own server and is working flawlessly.

Now i'm trying to add it to a friends website but i'm receving 403 error on form submit:

The error header seen is: x-amzn-errortype: MissingAuthenticationTokenException

And also when I try to call the API directly I get the same 403 error:
{
"message": "Missing Authentication Token"
}

I've got no clue where stuff is going wrong or what auth token I should add where to make it work. Any pointers and help is much appreciated.

@danielireson
Copy link
Owner

Hi Chris, that error is from API Gateway and is usually returned when you're using the wrong URL or one that doesn't exit.

@Bechrissed
Copy link
Author

Hi Daniel, thanks. I've checked the url (https://d4o3vwxlsg.execute-api.eu-west-1.amazonaws.com/prd/?format=json) and copy/pasted the endpoint. Unfortunatly the problem persists. Tried to run "serverless deploy" again but it returns same endpoint. Probably because nothing changed.

@Bechrissed
Copy link
Author

Bechrissed commented May 30, 2019

Found some more info here: https://forums.aws.amazon.com/thread.jspa?threadID=192977, will try some suggested solutions as url is correct for as far as I can see

@danielireson
Copy link
Owner

I think it might potentially be that you're using the wrong http method? I've just been able to POST successfully to your endpoint, are you perhaps doing a GET instead? That would tie in with the missing authentication token error as there's no GET route.

@Bechrissed
Copy link
Author

Bechrissed commented May 30, 2019

Yes that was the issue. I'm now facing an HTTP 422 error from cloudfront :s

I've never heard of 422 so have to google what's going wrong there.

@Bechrissed
Copy link
Author

Ah lol found it: {"statusCode":422,"message":"Please provide a recipient in '_to' field"}

@danielireson
Copy link
Owner

Good to hear you've fixed the issue, closing.

@Bechrissed
Copy link
Author

@danielireson is it an idea to also add an OPTIONS method to the API? I've added this myself now with a mock behind it but it does return the correct CORS headers. My ajax library (Axios) sends an OPTIONS request as part of the preflight for the ajax request. I know this can also be solved in Axios itself by changing the Content-Type headers but adding it to the API would make Formplug work out of the box in more situations.

@Bechrissed
Copy link
Author

Hmmmmm, also unable to fix error 422: {"statusCode":422,"message":"Please provide a recipient in '_to' field"}

_to field is filled, tried both encrypted an unencrypted:

firstName: saddas
lastName: asdsda
email: asasdds
phone: asdadsads
message: asdasdasasd
_honeypot:
_to: info@website.com

Any suggestions how to debug more?

@Bechrissed
Copy link
Author

Never mind got it fixed :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants