This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createS3(){ | |
var bucket = new AWS.S3({ | |
params: { | |
Bucket: 'backspace-cognito-test' | |
} | |
}); | |
//Object key will be facebook-USERID#/FILE_NAME | |
var objKey = 'facebook-'+FACEBOOK_USER.id+'/test.txt'; | |
var params = { | |
Key: objKey, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var AWS_ACCOUNT_ID = 'XXXXXXXXX'; | |
var AWS_REGION = 'us-east-1'; | |
var COGNITO_IDENTITY_POOL_ID = 'us-east-1:XXXXXXXd-XXXX-XXX-XXXX-XXXXXXXX'; | |
var COGNITO_IDENTITY_ID, COGNITO_SYNC_TOKEN, AWS_TEMP_CREDENTIALS; | |
var cognitosync; | |
var IAM_ROLE_ARN = 'arn:aws:iam::XXXXXXXXXX:role/Cognito_CognitoBrowserExampleAuth_DefaultRole'; | |
var COGNITO_SYNC_COUNT; | |
var COGNITO_DATASET_NAME = 'TEST_DATASET'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************************** | |
This is from the tutorial at http://blog.backspace.academy | |
Please go there for the latest code and explanation. | |
******************************************************************************************/ | |
(function($){ | |
var AWS_ACCOUNT_ID = 'XXXXXXXX'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OpenFB is a micro-library that lets you integrate your JavaScript application with Facebook. | |
* OpenFB works for both BROWSER-BASED apps and CORDOVA/PHONEGAP apps. | |
* This library has no dependency: You don't need (and shouldn't use) the Facebook SDK with this library. Whe running in | |
* Cordova, you also don't need the Facebook Cordova plugin. There is also no dependency on jQuery. | |
* OpenFB allows you to login to Facebook and execute any Facebook Graph API request. | |
* @author Christophe Coenraets @ccoenraets | |
* @version 0.4 | |
*/ | |
var openFB = (function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var AWS_ACCOUNT_ID = 'XXXXXXXX'; | |
var AWS_REGION = 'us-east-1'; | |
var COGNITO_IDENTITY_POOL_ID = 'us-east-1:XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX'; | |
var COGNITO_IDENTITY_ID, COGNITO_SYNC_TOKEN, AWS_TEMP_CREDENTIALS; | |
var cognitosync; | |
var IAM_ROLE_ARN = 'arn:aws:iam::XXXXXXXXX:role/Cognito_CognitoBrowserExampleAuth_DefaultRole'; | |
var COGNITO_SYNC_COUNT; | |
var COGNITO_DATASET_NAME = 'TEST_DATASET'; | |
var FACEBOOK_APP_ID = 'XXXXXXXXXXXXXX'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AWS Cognito App</title> | |
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" /> | |
</head> | |
<body> | |
<button id="btnLogin">Login with Facebook</button> | |
<button id="btnLogout">Logout</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- config.xml reference: https://build.phonegap.com/docs/config-xml --> | |
<widget xmlns = "http://www.w3.org/ns/widgets" | |
xmlns:gap = "http://phonegap.com/ns/1.0" | |
id = "technology.backspace.aws.cognito.example" | |
version = "1.0.0"> | |
<name>AWS Cognito Example App</name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": | |
[ | |
{ | |
"Action": [ | |
"mobileanalytics:PutEvents", | |
"cognito-sync:*" | |
], | |
"Effect": "Allow", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var router = express.Router(); | |
var passport = require('passport'); | |
var FacebookStrategy = require('passport-facebook').Strategy; | |
var AWS = require('aws-sdk'); | |
var colors = require('colors'); | |
var AWS_ACCOUNT_ID = 'XXXXXXXXXXX'; |
OlderNewer