OAuth authentication returning "Invalid State Token"



Trying to authenticate using OAuth but Mattermost returning “Invalid State Token”


Using Mattermost v4.10, oauth server returns access token {“access_token”:“c6e4db4d962d12974b79534f4b184bc5967217a4”,“token_type”:“Bearer”,“refresh_token”:“c75d76e8b23bb6ec0f0c568db925880f87a710e2”,“scope”:“api”,“created_at”:1528198820}
and looking at the mattermost logs I see the error below:
“[runtime error: invalid memory address or nil pointer dereference]”.

https://docs.mattermost.com/install/troubleshooting.html#panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference - I haven’t changed anything with the database manually so not sure why I would be getting that error but if I refresh the page I get an Invalid State Token with the error below:

“GetOAuthStateToken: Invalid state token, SqlTokenStore.GetByToken: store.sql_recover.get_by_code.app_error, sql: no rows in result set”

Any idea on what I might be doing wrong?


Can you provide the relevant information from this page? That will help us diagnose the problem.