Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

support temporary security credentials #327

Open
wants to merge 3 commits into from

1 participant

@robin

S3 now support Temporary Security Credentials. See detail at:
http://docs.amazonwebservices.com/AmazonS3/latest/dev/RESTAuthentication.html

Beside access key and secret access key, a session token is used. I made a patch for ASIS3Request to support the session key. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 5, 2012
  1. @robin
Commits on Dec 19, 2012
  1. @robin

    Merge branch 'main'

    robin authored
Commits on Apr 17, 2014
  1. @robin

    Merge branch 'main'

    robin authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +4 −0 Classes/S3/ASIS3Request.h
  2. +5 −0 Classes/S3/ASIS3Request.m
View
4 Classes/S3/ASIS3Request.h
@@ -52,6 +52,9 @@ typedef enum _ASIS3ErrorType {
// The access policy to use when PUTting a file (see the string constants at the top ASIS3Request.h for details on what the possible options are)
NSString *accessPolicy;
+
+ // The session token used by Temporary Security Credentials
+ NSString *sessionToken;
// Internally used while parsing errors
NSString *currentXMLElementContent;
@@ -106,4 +109,5 @@ typedef enum _ASIS3ErrorType {
@property (retain) NSString *currentXMLElementContent;
@property (retain) NSMutableArray *currentXMLElementStack;
@property (retain) NSString *requestScheme;
+@property (retain) NSString *sessionToken;
@end
View
5 Classes/S3/ASIS3Request.m
@@ -48,6 +48,7 @@ - (void)dealloc
[secretAccessKey release];
[accessPolicy release];
[requestScheme release];
+ [sessionToken release];
[super dealloc];
}
@@ -71,6 +72,9 @@ - (NSMutableDictionary *)S3Headers
if ([self accessPolicy]) {
[headers setObject:[self accessPolicy] forKey:@"x-amz-acl"];
}
+ if (self.sessionToken) {
+ [headers setObject:[self sessionToken] forKey:@"x-amz-security-token"];
+ }
return headers;
}
@@ -309,4 +313,5 @@ - (void)buildURL
@synthesize currentXMLElementStack;
@synthesize accessPolicy;
@synthesize requestScheme;
+@synthesize sessionToken;
@end
Something went wrong with that request. Please try again.