PHPackages                             samuelvi/spreadsheet-translator-provider-onedriveauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. samuelvi/spreadsheet-translator-provider-onedriveauth

ActiveLibrary[API Development](/categories/api)

samuelvi/spreadsheet-translator-provider-onedriveauth
=====================================================

Spreadsheet Translator - One Drive Provider with Authentication

v8.4.0(6mo ago)00MITPHPPHP &gt;=8.4CI passing

Since Nov 8Pushed 6mo agoCompare

[ Source](https://github.com/samuelvi/spreadsheet-translator-provider-onedriveauth)[ Packagist](https://packagist.org/packages/samuelvi/spreadsheet-translator-provider-onedriveauth)[ RSS](/packages/samuelvi-spreadsheet-translator-provider-onedriveauth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Spreadsheet Translator - Microsoft OneDrive Provider (with Authentication)
==========================================================================

[](#spreadsheet-translator---microsoft-onedrive-provider-with-authentication)

[![PHP Version](https://camo.githubusercontent.com/9c2f8ad80d34105266a94c4c06234f8ed18c968d3595039c2d9a7becd1e71c8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

This package provides a provider for the Spreadsheet Translator project that fetches shared spreadsheet documents from Microsoft OneDrive using OAuth 2.0 authentication.

Features
--------

[](#features)

- OAuth 2.0 authentication with Microsoft Live
- Supports both direct access token and interactive authentication flow
- Downloads Excel files from OneDrive via the Microsoft Live API
- Integrates seamlessly with the Spreadsheet Translator ecosystem
- Built with modern PHP 8.4 features

Installation
------------

[](#installation)

Install via Composer:

```
composer require samuelvi/spreadsheet-translator-provider-onedriveauth
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4
- Guzzle HTTP client ^7.7
- Microsoft Azure application credentials (client ID and secret)
- OneDrive file ID of the spreadsheet to fetch

Usage
-----

[](#usage)

### Configuration Options

[](#configuration-options)

The provider requires the following configuration options:

- `client_id`: Your Microsoft application client ID
- `client_secret`: Your Microsoft application client secret
- `callback_uri`: OAuth redirect URI configured in your Microsoft app
- `document_id`: The OneDrive file ID to fetch
- `access_token`: (Optional) Pre-obtained access token
- `prompt_for_access_token`: (Optional) Enable interactive OAuth flow
- `prompt_access_token_browser`: (Optional) Browser preference for OAuth (e.g., 'chrome', 'firefox')
- `scopes`: (Optional) Comma-separated OAuth scopes (e.g., 'wl.offline\_access,wl.skydrive\_update')

### Example Configuration

[](#example-configuration)

```
use Atico\SpreadsheetTranslator\Core\Configuration\Configuration;
use Atico\SpreadsheetTranslator\Provider\OneDriveAuth\OneDriveAuthProvider;

$config = new Configuration([
    'provider' => [
        'options' => [
            'client_id' => 'your-client-id',
            'client_secret' => 'your-client-secret',
            'callback_uri' => 'http://localhost/callback',
            'document_id' => 'file.abc123.ABC123',
            'access_token' => 'your-access-token', // or use prompt_for_access_token
            'temp_local_source_file' => '/tmp/spreadsheet.xlsx',
            'format' => 'xlsx'
        ]
    ]
]);

$provider = new OneDriveAuthProvider($config);
$resource = $provider->handleSourceResource();
```

### Interactive Authentication

[](#interactive-authentication)

If you don't have an access token, enable interactive authentication:

```
$config = new Configuration([
    'provider' => [
        'options' => [
            'client_id' => 'your-client-id',
            'client_secret' => 'your-client-secret',
            'callback_uri' => 'http://localhost/callback',
            'document_id' => 'file.abc123.ABC123',
            'prompt_for_access_token' => true,
            'prompt_access_token_browser' => 'chrome',
            'scopes' => 'wl.offline_access,wl.skydrive_update',
            'temp_local_source_file' => '/tmp/spreadsheet.xlsx',
            'format' => 'xlsx'
        ]
    ]
]);
```

Development
-----------

[](#development)

### Available Commands

[](#available-commands)

The project includes a Makefile with common development tasks:

```
make help              # Show all available commands
make install           # Install dependencies
make update            # Update dependencies
make test              # Run unit tests
make test-coverage     # Run tests with coverage report
make phpstan           # Run PHPStan static analysis
make rector            # Run Rector to upgrade code
make rector-dry        # Run Rector in dry-run mode (preview changes)
make lint              # Run all linting tools
make fix               # Auto-fix code with Rector
make clean             # Clean generated files
make all               # Install, lint, and test
make ci                # Run CI pipeline
```

### Running Tests

[](#running-tests)

```
# Run all tests
make test

# Run tests with coverage
make test-coverage

# Run specific test
vendor/bin/phpunit tests/AuthTest.php
```

### Code Quality

[](#code-quality)

```
# Static analysis with PHPStan (level 8 + Mockery extension)
make phpstan

# Code refactoring (dry-run)
make rector-dry

# Apply code refactoring
make rector
```

Architecture
------------

[](#architecture)

This provider implements the `ProviderInterface` from the Core package and consists of:

- **OneDriveAuthProvider**: Main provider class that orchestrates the OAuth flow
- **Auth**: Handles OAuth 2.0 authentication with Microsoft Live
- **Client**: OneDrive API client for fetching file content
- **CommandLineAccessTokenManager**: Interactive CLI tool for obtaining OAuth tokens
- **OneDriveAuthConfigurationManager**: Configuration management

Related Packages
----------------

[](#related-packages)

- [Core Bundle](https://github.com/samuelvi/spreadsheet-translator-core) - Base interfaces and utilities
- [Symfony Bundle](https://github.com/samuelvi/spreadsheet-translator-symfony-bundle) - Symfony integration

Contributing
------------

[](#contributing)

We welcome contributions to this project, including pull requests and issues (and discussions on existing issues).

If you'd like to contribute code but aren't sure what, the issues list is a good place to start. If you're a first-time code contributor, you may find Github's guide to [forking projects](https://guides.github.com/activities/forking/) helpful.

All contributors (whether contributing code, involved in issue discussions, or involved in any other way) must abide by our code of conduct.

### Development Setup

[](#development-setup)

1. Clone the repository
2. Run `make install` to install dependencies
3. Run `make test` to ensure tests pass
4. Make your changes
5. Run `make lint` to check code quality
6. Run `make test` to verify tests still pass
7. Submit a pull request

License
-------

[](#license)

Spreadsheet Translator OneDrive Auth Provider is licensed under the MIT License. See the LICENSE file for full details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance68

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

185d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10146931?v=4)[Samuel Vicent](/maintainers/samuelvi)[@samuelvi](https://github.com/samuelvi)

---

Top Contributors

[![TakeAChef](https://avatars.githubusercontent.com/u/93644533?v=4)](https://github.com/TakeAChef "TakeAChef (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/samuelvi-spreadsheet-translator-provider-onedriveauth/health.svg)

```
[![Health](https://phpackages.com/badges/samuelvi-spreadsheet-translator-provider-onedriveauth/health.svg)](https://phpackages.com/packages/samuelvi-spreadsheet-translator-provider-onedriveauth)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
