amazon-connect / amazon-connect-salesforce-scv

This repository contains resources, examples, and projects to help Service Cloud Voice customers address some common requirements as they deploy Service Cloud Voice.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAuth Token Failed using JWT

shaun0024 opened this issue · comments

I think the authentication for using JWT under the Python layer.

On line 33 of the file sf_auth.py, it converts datetime to int, which is what is causing the problem I think. I think it needs to remain as datetime.

It appears to be working after I removed the conversion. I changed:

exp = int((datetime.utcnow() + timedelta(minutes=SalesforceConfig.TOKEN_VALID_FOR)).timestamp())

to:

exp = datetime.utcnow() + timedelta(minutes=SalesforceConfig.TOKEN_VALID_FOR)

you can use either int or datetime, we happen to use int. Can you describe the issue you see that caused you to change that? we have no other implementations that have run into this.

I can’t recall the exact error but I believe it was a 40x error when attempting to obtain an access token. I had written my own code to perform a similar operation before using the same jar and requests modules before and when comparing the both, the difference that I spotted was mine was using date time while this was using int. So I tried changing it and it worked.

Unable to replicate this issue in any other environment. No further feedback.