{"id":20527371,"url":"https://github.com/mayankagrawal94/onedrive-poc","last_synced_at":"2025-03-06T01:49:15.026Z","repository":{"id":245709797,"uuid":"819023341","full_name":"MayankAgrawal94/onedrive-poc","owner":"MayankAgrawal94","description":"The OneDrive App facilitates file management and access control on Microsoft's cloud storage platform. It lists and downloads files, monitors file access rights, and notifies users of access changes. Secure authentication via Microsoft OAuth2 ensures safe handling of user credentials and controlled resource access.","archived":false,"fork":false,"pushed_at":"2024-07-07T12:46:57.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T11:32:37.308Z","etag":null,"topics":["azure","express","express-session","ms-graph-api","nodejs","oauth2","onedrive-api","socket-io"],"latest_commit_sha":null,"homepage":"https://onedrive.demo.mayankagrawal.co.in","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MayankAgrawal94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-23T14:59:44.000Z","updated_at":"2024-07-05T08:41:18.000Z","dependencies_parsed_at":"2024-11-15T23:18:50.558Z","dependency_job_id":"7a113dd1-bbcf-4715-93b6-7474881b13aa","html_url":"https://github.com/MayankAgrawal94/onedrive-poc","commit_stats":null,"previous_names":["mayankagrawal94/onedrive-poc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayankAgrawal94%2Fonedrive-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayankAgrawal94%2Fonedrive-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayankAgrawal94%2Fonedrive-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MayankAgrawal94%2Fonedrive-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MayankAgrawal94","download_url":"https://codeload.github.com/MayankAgrawal94/onedrive-poc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242133482,"owners_count":20077097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","express","express-session","ms-graph-api","nodejs","oauth2","onedrive-api","socket-io"],"created_at":"2024-11-15T23:18:34.294Z","updated_at":"2025-03-06T01:49:15.004Z","avatar_url":"https://github.com/MayankAgrawal94.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneDrive App\n\n## What does this program do?\n\nThis program connects to OneDrive to:\n- List files\n- Download files\n- List all users who have access to a file\n- Provides real-time updates on user access changes\n\n## Authentication\n\nThis application implements Microsoft OAuth2 for secure login and authorization. Users will be prompted to log in with their Microsoft account, granting the application access to their OneDrive data. The OAuth2 flow ensures that user credentials are handled securely and that the application only accesses the resources explicitly permitted by the user.\n\n## How to execute it?\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/MayankAgrawal94/onedrive-poc.git\n    cd onedrive-poc\n    ```\n\n2. Install dependencies:\n    ```bash\n    npm install\n    ```\n\n3.  **Setup Environment Variables**\n    Create a `.env` file in the root directory of `onedrive-poc` and add the following environment variables, filling in the missing values:\n\n    ```\n    PORT=3001\n    BASE_URL=http://localhost:3001\n\n    AZURE_CLIENT_ID=\n    AZURE_CLIENT_SECRET=\n    AZURE_TENANT_ID=\n    MS_AUTH_ENDPOINT=https://login.microsoftonline.com/common/oauth2/v2.0\n    MS_GRAPH_ENDPOINT=https://graph.microsoft.com/v1.0\n\n    SESSION_SECRET=     #For internal 'express-session' configuration\n    COOKIE_MAX_AGE=1    # in days\n\n    ```\n\n    **Note:** When registering a new app in Azure, make sure to add the 'Redirect URI' as `{BASE_URL}/v1/auth/ms/cb`.\n    \n4. Start the server:\n    ```bash\n    npm run start\n    ```\n\n5. Open the client:\n    Open `http://localhost:3001` in a web browser.\n\n## Project Structure\n```\n.\n├── package.json\n├── package-lock.json\n├── README.md\n└── src\n    ├── app\n    │   ├── controllers\n    │   │   ├── auth\n    │   │   │   ├── basic.auth.controller.js\n    │   │   │   └── ms.auth.controller.js\n    │   │   └── msOneDrive.controller.js\n    │   ├── helpers\n    │   │   ├── genericFun.js\n    │   │   └── onedrive.js\n    │   ├── routes\n    │   │   ├── auth\n    │   │   │   ├── basicAuth.routes.js\n    │   │   │   └── msAuth.routes.js\n    │   │   └── msOneDrive.routes.js\n    │   └── services\n    │       ├── auth\n    │       │   ├── index.js\n    │       │   ├── oauthCallback.js\n    │       │   ├── oauthRequest.js\n    │       │   └── refreshToken.js\n    │       └── onedrive.js\n    ├── app.js\n    ├── config\n    │   ├── env.js\n    │   └── session.config.js\n    ├── middleware\n    │   └── isAuthenticated.js\n    ├── public\n    │   ├── assests\n    │   │   ├── document-icon.png\n    │   │   ├── download-icon.png\n    │   │   └── folder-icon.png\n    │   ├── index.html\n    │   ├── scripts\n    │   │   └── logic.js\n    │   ├── styles\n    │   │   ├── tree-container.css\n    │   │   └── welcome.css\n    │   └── welcome.html\n    ├── server.js\n    └── socket.js\n```\n\n## Test the real-time updates:\n- Login with valid a OneDrive account and click the \"Watch File\" button.\n- The permissions will be displayed and updated in real-time as they change.\n\n## Contributing\nIf you have any suggestions or improvements, feel free to submit a pull request or open an issue.\n\n## Contact\nIf you have any feedback, questions, or suggestions, feel free to reach out.\nconnect me at `jobs@mayankagrawal.co.in` or can DM me on [LinkedIn](https://www.linkedin.com/in/mayank-agrawal-59192940/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayankagrawal94%2Fonedrive-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayankagrawal94%2Fonedrive-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayankagrawal94%2Fonedrive-poc/lists"}