{"action":"closed","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/481","repository_url":"https://api.github.com/repos/aws/aws-sdk-ios","labels_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/481/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/481/events","html_url":"https://github.com/aws/aws-sdk-ios/issues/481","id":180334423,"number":481,"title":"Custom Credential Provider Issue - Swift2.2 , AWS 2.4.9, AWSCredentials AWSCredentialsProvider ","user":{"login":"Bhat123","id":7672290,"avatar_url":"https://avatars.githubusercontent.com/u/7672290?v=3","gravatar_id":"","url":"https://api.github.com/users/Bhat123","html_url":"https://github.com/Bhat123","followers_url":"https://api.github.com/users/Bhat123/followers","following_url":"https://api.github.com/users/Bhat123/following{/other_user}","gists_url":"https://api.github.com/users/Bhat123/gists{/gist_id}","starred_url":"https://api.github.com/users/Bhat123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bhat123/subscriptions","organizations_url":"https://api.github.com/users/Bhat123/orgs","repos_url":"https://api.github.com/users/Bhat123/repos","events_url":"https://api.github.com/users/Bhat123/events{/privacy}","received_events_url":"https://api.github.com/users/Bhat123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-30T15:34:22Z","updated_at":"2016-10-03T15:38:55Z","closed_at":"2016-10-03T15:38:55Z","body":"Hi All,\r\n\r\n I am creating the custom credential provider so that i can set accesskey , secretkey , token and expiration however i am receiving the below error while uploading the file \r\n**[__NSCFString expiration]: unrecognized selector sent to instance**\r\n\r\nBelow is the Custom class i have created using Swift 2.2 .. Kindly help me here in resolving the above issue \r\n\r\n### \r\n_```\r\nimport AWSS3\r\nimport AWSCore.AWSCredentialsProvider\r\nclass MYAWSCredentialProvider:AWSCredentials, AWSCredentialsProvider{\r\n    var bucketName:String!\r\n    var token:String!\r\n    var awsAccessKey: String!\r\n    var awsSecretKey: String!\r\n    var awsExpiration: NSDate?\r\n    var awsRegion:String!\r\n    \r\n    static let sharedInstance = MYAWSCredentialProvider(accessKey: \"\", secretKey: \"\", sessionKey: \"\")\r\n    \r\n    @objc func logins() -> AWSTask {\r\n        return AWSTask(result: token)\r\n    }\r\n\r\n     init(accessKey: String, secretKey: String, sessionKey: String?) {\r\n        super.init()\r\n        self.token = sessionKey\r\n        self.awsAccessKey = accessKey\r\n        self.awsSecretKey = secretKey\r\n    }\r\n    private static func sharedInstanceWith(accessKey: String, secretKey: String, sessionKey: String) -> MYAWSCredentialProvider {\r\n        let instance = MYAWSCredentialProvider.sharedInstance\r\n        instance.token = sessionKey\r\n        instance.awsAccessKey = accessKey\r\n        instance.awsSecretKey = secretKey\r\n        return instance\r\n    }\r\n     func updateAWSInfo (jsonString: JSON) {\r\n         awsAccessKey               = jsonString[\"accessKey\"].stringValue\r\n         awsSecretKey               = jsonString[\"secretKey\"].stringValue\r\n         bucketName                 = jsonString[\"bucketName\"].stringValue\r\n         awsRegion                     = jsonString[\"region\"].stringValue\r\n         token                      = jsonString[\"token\"].stringValue\r\n        let expirationTime         = jsonString[\"expirationTime\"].stringValue\r\n        let dateFormatter = NSDateFormatter()\r\n        dateFormatter.dateFormat = \"E MMM d HH:mm:ss 'UTC' YYYY\"////Fri Sep 30 14:42:53 UTC 2016\r\n        let date = dateFormatter.dateFromString(expirationTime)\r\n        awsExpiration      =  date\r\n        let credentialsProvider = MYAWSCredentialProvider.sharedInstanceWith(awsSecretKey, secretKey: awsSecretKey, sessionKey: token)\r\n        let configuration = AWSServiceConfiguration(region:AWSRegionType.APSoutheast1, credentialsProvider:credentialsProvider)\r\n        configuration.maxRetryCount = 3;\r\n        AWSServiceManager.defaultServiceManager().defaultServiceConfiguration = configuration\r\n    }\r\n    @objc func credentials() -> AWSTask {\r\n        return AWSTask(result: token)\r\n    }\r\n     func invalidateCachedTemporaryCredentials(){\r\n        \r\n    }\r\n}\r\n```_\r\n"}}
{"actor":{"display_login":"karthiksaligrama"}}