1

This is my Python code (that I've checked and it works):

from warrant.aws_srp import AWSSRP

def auth(USERNAME,PASSWORD):
 client = boto3.client('cognito-idp',region_name=region_name)

 aws = AWSSRP(username=USERNAME, password=PASSWORD, pool_id=POOL_ID,
             client_id=CLIENT_ID,client=client)
 try:
    tokens = aws.authenticate_user()
    return(tokens)
 except Exception as e:
    return(e)

I'm working with R in order to create a visual interface for doing some operation (including this one) and it is a requirement.

I use the reticulare R package to execute Python code. I tested it with some dummy code in order to check the correct functioning (and it is okay). When i execute the above function by running:

 reticulate::source_python(FILE_PATH)
 py$auth(USERNAME,PASSWORD)

i get the following error:

An error occurred (InvalidParameterException) when calling the RespondToAuthChallenge operation: TIMESTAMP format should be EEE MMM d HH:mm:ss z yyyy in english.

I tried to search a lot but I found nothing, I suppose that can exist a sort of wrapper or formatter. Maybe someone as already face this problem...

Thank a lot of any help.

tom
  • 48
  • 5
  • In the remote case that someone face the same problem, I solved it by not using reticulate but by calling directly the Python scipt in R as system line command. – tom Oct 08 '21 at 14:48

0 Answers0