i attempting save bit of info dynamodb table. table has been created already, received following error.
caused by: com.amazonaws.amazonserviceexception: security token included in request expired (service: amazondynamodbv2; status code: 400; error code: expiredtokenexception; request id: ma87st04upa57cmujqis8dbs4fvv4kqnso5aemvjf66q9asuaajg)
it's worth noting managed info save once, no longer saves after first time.
here's code.
public class signup extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.test); if (android.os.build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } } public void signup(view view){ cognitocachingcredentialsprovider cognitoprovider = new cognitocachingcredentialsprovider( this, // context current activity "us-east-1:xxxxx", /* identity pool id */ regions.us_east_1 /* region */ ); amazondynamodbclient ddbclient = new amazondynamodbclient(cognitoprovider); dynamodbmapper mapper = new dynamodbmapper(ddbclient); textview name = (textview)findviewbyid(r.id.name); textview email = (textview)findviewbyid(r.id.email); textview username = (textview)findviewbyid(r.id.username); textview password = (textview)findviewbyid(r.id.password); textview phone = (textview)findviewbyid(r.id.phone); userinfo userinfo = new userinfo(); userinfo.setname(name.gettext().tostring()); userinfo.setemail(email.gettext().tostring()); userinfo.setusername(username.gettext().tostring()); userinfo.setpassword(password.gettext().tostring()); userinfo.setphone(phone.gettext().tostring()); mapper.save(userinfo); toast.maketext(this, "finished!", toast.length_long).show(); } }
all appreciated.
this error unrelated february cognito announcement. looks me clock skew error. if have left emulator open awhile or changed clock on phone possible token generated sdk not match aws expecting... sdk suppose automatically correct clock skew errors. can check clock on device/emulator , see if problem? if i'd interested in exact circumstances improve sdk.
thanks, weston