Miguel Quintana
asked on
Amazon Web Services: cannot find credentials
Having an error creating a topic on AWS SNS.
I have built the project from VS 2013 then exported the release folder (DLL and TLB files) to a folder in a virtual machine where I have a VB6 project with a reference to the TLB file.
When I debug the project I get this error below... I hardcoded credentials on the app.config but this function is still asking for the "awsSession token" and I don't know how to get it.
The easiest way seems to be exporting credentials to the Virtual machine, but don't know how to do that
BTW, why the error is retreaving the path of the developing environment??
Exception:
Code:
App.config
I have built the project from VS 2013 then exported the release folder (DLL and TLB files) to a folder in a virtual machine where I have a VB6 project with a reference to the TLB file.
When I debug the project I get this error below... I hardcoded credentials on the app.config but this function is still asking for the "awsSession token" and I don't know how to get it.
The easiest way seems to be exporting credentials to the Virtual machine, but don't know how to do that
BTW, why the error is retreaving the path of the developing environment??
Exception:
at Amazon.Runtime.FallbackCredentialsFa ctory.GetC redentials (Boolean fallbackToAnonymous)
at Amazon.Runtime.FallbackCredentialsFa ctory.GetC redentials ()
at Amazon.SimpleNotificationService.Ama zonSimpleN otificatio nServiceCl ient..ctor ()
at AwsTranscoderNew.ClassConnect.Create Topic(Stri ng emailAddress) in d:\NAC de todo\Amazon\AMAZON DEV2\AwsTranscoderNew\AwsT ranscoderN ew\ClassCo nnect.cs:l ine 177
at AwsTranscoderNew.ClassConnect.classC onnect(Str ing sourceFile, String outputFilename, String email) in d:\NAC de todo\Amazon\AMAZON DEV2\AwsTranscoderNew\AwsT ranscoderN ew\ClassCo nnect.cs:l ine 82
Code:
var snsClient = new AmazonSimpleNotificationServiceClient(); //accessKey, SecretAccess
var topicArn = snsClient.CreateTopic(new CreateTopicRequest
{
Name = "TranscodeEvents" + UNIQUE_POSTFIX
}).TopicArn;
snsClient.Subscribe(new SubscribeRequest
{
TopicArn = topicArn,
Protocol = "email",
Endpoint = emailAddress
});
return topicArn;
App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="AWSProfileName" value="Developer" />
<add key="AWSRegion" value="eu-west-1" />
<add key="AWSProfilesLocation" value="C:\aws_service_credentials\credentials"/>
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ClientSettingsProvider.ConnectionStringName" value="DefaultConnection" />
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientWindowsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" connectionStringName="DefaultConnection" credentialsProvider="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" connectionStringName="DefaultConnection" />
</providers>
</roleManager>
</system.web>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source = |SQL/CE|" />
</connectionStrings>
</configuration>
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Hi Miguel,
As far as I know, no, you cannot embed an app.config file. I think you'd have to investigate an alternative if you were concerned about keeping your credentials secure.
As far as I know, no, you cannot embed an app.config file. I think you'd have to investigate an alternative if you were concerned about keeping your credentials secure.
ASKER
This config file can be embedded into the dll file, right? so I can hide all the account details after deployment in the production environment?