public async Task <IHttpActionResult> AuthRedirect(string code)
        {
            // Redeem authorization code for account information

            OAuthHelper helper = new OAuthHelper(SharedConfig.TokenService,
                                                 SharedConfig.AppClientID,
                                                 SharedConfig.AppClientSecret,
                                                 SharedConfig.RedirectUri);

            var token = await helper.RedeemAuthorizationCodeAsync(code);

            if (null == token)
            {
                return(JsonResponseEx.Create(HttpStatusCode.InternalServerError, new { message = "Invalid response from token service.", code = "tokenServiceNullResponse" }));
            }

            Account account = new Account(token);
            var     client  = await SharedConfig.GetOneDriveClientForAccountAsync(account);

            var rootDrive = await client.Drive.Request().GetAsync();

            account.Id          = rootDrive.Id;
            account.DisplayName = rootDrive.Owner.User.DisplayName;

            var existingAccount = await AzureStorage.LookupAccountAsync(rootDrive.Id);

            if (null == existingAccount)
            {
                await AzureStorage.InsertAccountAsync(account);

                existingAccount = account;
            }
            else
            {
                existingAccount.SetTokenResponse(token);
                await AzureStorage.UpdateAccountAsync(existingAccount);
            }

            var authCookie = CookieForAccount(existingAccount);

            return(RedirectResponse.Create("/default.aspx", authCookie));
        }