Cannot read property 'hex' of undefined in AWS SDK
One of the possible issues that the order of included scripts is important, this works:
<script type="text/javascript" src="jsbn.js"></script>
<script type="text/javascript" src="jsbn2.js"></script>
<script type="text/javascript" src="sjcl.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="aws-cognito-sdk.min.js"></script>
<script type="text/javascript" src="amazon-cognito-identity.min.js"></script>
But this gives read property 'hex' of undefined
:
<script type="text/javascript" src="jsbn.js"></script>
<script type="text/javascript" src="jsbn2.js"></script>
<script type="text/javascript" src="moment.js"></script>
<script type="text/javascript" src="aws-cognito-sdk.min.js"></script>
<script type="text/javascript" src="amazon-cognito-identity.min.js"></script>
<script type="text/javascript" src="sjcl.js"></script> <!--- wrong, to late
Also not forget to use SJCL
with code byte options. Here is very basic demo with all lib js files included:
AWS Cognito pool
You need to enter Cognito pool parameters on demo form
You can found Cognito User Pool Id
on Pool details
page. You also need to add App on Apps
page, and when you add an app ensure not to generate secret (this is not supported by javascript SDK):
When App created copy Cognito Client ID form Apps
page