Name: digits-with-aws
Owner: Crashlytics, Inc.
Description: Integration of Digits for Android with AWS services (Cognito, Lambda and DynamoDB)
Created: 2015-07-07 00:50:46.0
Updated: 2017-12-11 12:51:49.0
Pushed: 2016-03-06 02:00:38.0
Homepage: http://digits.com
Size: 690
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This sample code demonstrates using Twitter Digits to enable phone-based authentication, and using the AWS platform – Cognito, Lambda and DynamoDB – to provide simple and scalable back-end services for your mobile application.
Once you have this sample running, you can imagine other possible phone-based use cases, including:
The requirements needed to use this sample code are:
Follow the below steps to setup the Android App and the back-end AWS services:
As a final note, ensure that all AWS instances are located in US-East, so that they can make full use of Cognito and can connect to one another.
Once you have your token/secret, you want to add them into a properties file that the app reads. Copy the app.properties.template
file into app.properties
and add them under TWITTER_KEY and TWITTER_SECRET.
In order to get your access key and secret for the HTML example, follow the below instructions:
Below is a screenshot of the identity pool creation page, for your reference:
You'll now want to add this into the app.properties
file in the AWS_IDENTITY_POOL_ID property.
To store and retrieve records on the server, the Lambda service connects to a DynamoDB instance. To easily create a store, follow the below instrutions:
After your app is fully deployed and running, you can also view the saved entries via the “Explore Table” button on the DynamoDB console. You should see records that look like the following:
To create a scalable and simple Lambda service for this code, following the below steps:
lambda/server.js
into the code area on the pageTo test that your service works properly, you can open the digitsLogin detail page and use the “Sample event” + Invoke button to execute the code. The sample JSON for testing is located in lambda/server_event.json
file. The test area should like the below:
The following documents serve as additional information on the Amazon platform and Twitter Digits.