Skip to content

Commit

Permalink
Implements #10: Access to Amazon Cloud Drive
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrodan committed Aug 19, 2016
1 parent d19d805 commit 09f6745
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions KeeAnywhere/KeeAnywhere.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="AmazonCloudDriveApi, Version=1.2.5.29289, Culture=neutral, PublicKeyToken=04c0977977f105bc, processorArchitecture=MSIL">
<HintPath>..\packages\AmazonCloudDriveApi.1.2.5\lib\net45\AmazonCloudDriveApi.dll</HintPath>
<Private>True</Private>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\AmazonCloudDriveApi.dll</HintPath>
</Reference>
<Reference Include="AWSSDK.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.1.10.0\lib\net45\AWSSDK.Core.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public async Task<AccountConfiguration> CreateAccount()

if (!isOk) return null;

var amazonAccount = _api.Account;
var profile = await _api.Profile.GetProfile();

var account = new AccountConfiguration()
{
Id = "amzn",
Name = "Amazon Account",
Id = profile.user_id,
Name = profile.name,
Type = StorageType.AmazonDrive,
Secret = _token.RefreshToken,
};
Expand All @@ -39,6 +39,10 @@ public async Task<AccountConfiguration> CreateAccount()

public async Task Initialize()
{
var loginUri = _api.BuildLoginUrl(this.RedirectionUrl.ToString(),
ACD.CloudDriveScopes.ReadOther | ACD.CloudDriveScopes.Write | ACD.CloudDriveScopes.Profile);

this.AuthorizationUrl = new Uri(loginUri);
}

public async Task<bool> Claim(Uri uri, string documentTitle)
Expand All @@ -59,9 +63,7 @@ public async Task<bool> Claim(Uri uri, string documentTitle)

public Uri PreAuthorizationUrl { get { return null; } }

public Uri AuthorizationUrl {
get { return new Uri(_api.BuildLoginUrl(this.RedirectionUrl.ToString(), ACD.CloudDriveScopes.ReadOther | ACD.CloudDriveScopes.Write)); }
}
public Uri AuthorizationUrl { get; protected set; }

public Uri RedirectionUrl { get { return new Uri("http://localhost/auth_redirection"); } }

Expand Down
Binary file added lib/AmazonCloudDriveApi.dll
Binary file not shown.

0 comments on commit 09f6745

Please sign in to comment.