Skip to content

Commit 72d9675

Browse files
author
Bob Kinney
committed
Update note about embedding credentials
1 parent 57c0843 commit 72d9675

File tree

32 files changed

+167
-47
lines changed

32 files changed

+167
-47
lines changed

AWSPersistence_Locations2/README.md

100755100644
File mode changed.

DynamoDB_WIF_UserPreference/README.md

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ For a more detailed description of the code, please visit this [online article](
88
2. Configure the sample with your AWS security credentials or WIF:
99
1. If using AWS security credentials:
1010
1. Open the `Constants.h` file.
11-
2. Modify the `ACCESS_KEY` and `SECRET_KEY` definitions with your AWS Credentials.
11+
2. Modify the `ACCESS_KEY` and `SECRET_KEY` definitions with your AWS Credentials.
12+
**DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.**
1213
2. If using Web Identity Federation(WIF), see the [README](../S3_WIF_PersonalFileStore/README.md) file under `/S3_WIF_PersonalFileStore/`.
1314
3. Add the AWS SDK for iOS Frameworks to the sample.
1415
1. In the Project Navigator, Right-Click on the Frameworks group.

DynamoDB_WIF_UserPreference/UserPreference/AmazonClientManager.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,20 @@ -(void)initClients
7575
}
7676
}
7777

78+
7879
+(void)initClientsWithEmbeddedCredentials
7980
{
80-
if (ddb == nil) {
81+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
82+
// This sample App is for demonstration purposes only.
83+
// It is not secure to embed your credentials into source code.
84+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
85+
// We offer two solutions for getting credentials to your mobile App.
86+
// Please read the following article to learn about Token Vending Machine:
87+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
88+
// Or consider using web identity federation:
89+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
90+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
91+
if (ddb == nil) {
8192
AmazonCredentials *credentials = [[[AmazonCredentials alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY] autorelease];
8293
[ddb release];
8394
ddb = [[AmazonDynamoDBClient alloc] initWithCredentials:credentials];

DynamoDB_WIF_UserPreference/UserPreference/Constants.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,17 @@
1616
#define TEST_TABLE_NAME @"TestUserPreference"
1717
#define TEST_TABLE_HASH_KEY @"userNo"
1818

19-
2019
//Fill in these two fields to bypass WIF
20+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21+
// This sample App is for demonstration purposes only.
22+
// It is not secure to embed your credentials into source code.
23+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
24+
// We offer two solutions for getting credentials to your mobile App.
25+
// Please read the following article to learn about Token Vending Machine:
26+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
27+
// Or consider using web identity federation:
28+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
29+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2130
#define ACCESS_KEY_ID @"CHANGE ME"
2231
#define SECRET_KEY @"CHANGE ME"
2332

README.md

100755100644
File mode changed.

S3_S3TransferManager/README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
<html>
2-
<body>
3-
<h2>Running the S3_S3TransferManager Sample</h2>
4-
<p>This sample demonstrates the pause and resume features of the S3TransferManager found in the S3 SDK.</p>
5-
<p>For a more detailed description of the code, please visit this <a href="S3TransferManager.html">writeup</a>.
6-
<ol>
7-
<li>Open the <code>S3TransferManager.xcodeproj</code> project file in Xcode. </li>
8-
<li>Configure the sample with your AWS security credentials:
9-
<ol>
10-
<li>Open the <code>Constants.h</code> file. </li>
11-
<li>Modify the <code>ACCESS_KEY</code> and <code>SECRET_KEY</code> definitions with your AWS Credentials. </li>
12-
</ol>
13-
</li>
14-
<li>Add the AWS SDK for iOS Frameworks to the sample. Get it <a href="http://aws.amazon.com/sdkforios/">here</a>.
15-
<ol>In the Project Navigator, Right-Click on the Frameworks group.</ol>
16-
<ol>In the Menu select Add Files to "S3TransferManager"</ol>
17-
<ol>Navigate to the location where you downloaded and expanded the AWS SDK for iOS.</ol>
18-
<ol>Select the follwing frameworks and click Add
19-
<ol>AWSRuntime.framework</ol>
20-
<ol>AWSS3.framework</ol>
21-
<ol>
22-
</li>
23-
<li>Run the project.</li>
24-
</ol>
25-
</body>
26-
</html>
1+
##Running the S3_S3TransferManager Sample
2+
This sample demonstrates the pause and resume features of the S3TransferManager found in the S3 SDK.
3+
For a more detailed description of the code, please visit this [writeup](S3TransferManager.html).
4+
5+
1. Open the <code>S3TransferManager.xcodeproj</code> project file in Xcode.
6+
2. Configure the sample with your AWS security credentials:
7+
1. Open the <code>Constants.h</code> file.
8+
2. Modify the <code>ACCESS_KEY</code> and <code>SECRET_KEY</code> definitions with your AWS Credentials.
9+
**DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.**
10+
3. Add the AWS SDK for iOS Frameworks to the sample. Get it [here](http://aws.amazon.com/sdkforios/).
11+
1. In the Project Navigator, Right-Click on the Frameworks group.
12+
2. In the Menu select Add Files to "S3TransferManager"
13+
3. Navigate to the location where you downloaded and expanded the AWS SDK for iOS.
14+
4. Select the follwing frameworks and click Add
15+
* AWSRuntime.framework
16+
* AWSS3.framework
17+
4. Run the project.

S3_S3TransferManager/S3TransferManager/Constants.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020
// This sample App is for demonstration purposes only.
2121
// It is not secure to embed your credentials into source code.
22-
// Please read the following article for getting credentials
23-
// to devices securely.
24-
// http://aws.amazon.com/articles/Mobile/4611615499399490
22+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
23+
// We offer two solutions for getting credentials to your mobile App.
24+
// Please read the following article to learn about Token Vending Machine:
25+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
26+
// Or consider using web identity federation:
27+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
2528
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2629
#define ACCESS_KEY_ID @"CHANGE ME"
2730
#define SECRET_KEY @"CHANGE ME"

S3_S3TransferManager/S3TransferManager/S3TransferManagerDownloadViewController.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ - (void)viewDidLoad
3737
)
3838
{
3939
// Initialize the S3 Client.
40+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41+
// This sample App is for demonstration purposes only.
42+
// It is not secure to embed your credentials into source code.
43+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
44+
// We offer two solutions for getting credentials to your mobile App.
45+
// Please read the following article to learn about Token Vending Machine:
46+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
47+
// Or consider using web identity federation:
48+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
49+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4050
AmazonS3Client *s3 = [[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID
4151
withSecretKey:SECRET_KEY];
4252
s3.endpoint = [AmazonEndpoints s3Endpoint:US_WEST_2];

S3_SimpleDB_SNS_SQS_Demo/AWSiOSDemo/Classes/AmazonClientManager.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ +(bool)hasCredentials
5858

5959
+(void)validateCredentials
6060
{
61+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62+
// This sample App is for demonstration purposes only.
63+
// It is not secure to embed your credentials into source code.
64+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
65+
// We offer two solutions for getting credentials to your mobile App.
66+
// Please read the following article to learn about Token Vending Machine:
67+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
68+
// Or consider using web identity federation:
69+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
70+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
71+
6172
if ((sdb == nil) || (s3 == nil) || (sqs == nil) || (sns == nil)) {
6273
[AmazonClientManager clearCredentials];
6374

S3_SimpleDB_SNS_SQS_Demo/AWSiOSDemo/Classes/Constants.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1818
// This sample App is for demonstration purposes only.
1919
// It is not secure to embed your credentials into source code.
20-
// Please read the following article for getting credentials
21-
// to devices securely.
22-
// http://aws.amazon.com/articles/Mobile/4611615499399490
20+
// DO NOT EMBED YOUR CREDENTIALS IN PRODUCTION APPS.
21+
// We offer two solutions for getting credentials to your mobile App.
22+
// Please read the following article to learn about Token Vending Machine:
23+
// * http://aws.amazon.com/articles/Mobile/4611615499399490
24+
// Or consider using web identity federation:
25+
// * http://aws.amazon.com/articles/Mobile/4617974389850313
2326
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2427
#define ACCESS_KEY_ID @"CHANGE ME"
2528
#define SECRET_KEY @"CHANGE ME"

0 commit comments

Comments
 (0)