{"id":22824350,"url":"https://github.com/mmalcek/basictooauth","last_synced_at":"2025-04-23T07:41:34.944Z","repository":{"id":59633620,"uuid":"537946787","full_name":"mmalcek/basicToOauth","owner":"mmalcek","description":"proxy service that changes basic auth to oauth 2. designed for Exchange Web Services (EWS)","archived":false,"fork":false,"pushed_at":"2022-09-20T09:22:50.000Z","size":28,"stargazers_count":18,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:51:10.746Z","etag":null,"topics":["azure","basic-authentication","ews","exchange","oauth2","office365"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmalcek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-17T22:41:55.000Z","updated_at":"2024-12-04T08:18:45.000Z","dependencies_parsed_at":"2022-09-19T00:50:48.973Z","dependency_job_id":null,"html_url":"https://github.com/mmalcek/basicToOauth","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmalcek%2FbasicToOauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmalcek%2FbasicToOauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmalcek%2FbasicToOauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmalcek%2FbasicToOauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmalcek","download_url":"https://codeload.github.com/mmalcek/basicToOauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250394355,"owners_count":21423360,"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","basic-authentication","ews","exchange","oauth2","office365"],"created_at":"2024-12-12T17:06:18.977Z","updated_at":"2025-04-23T07:41:34.912Z","avatar_url":"https://github.com/mmalcek.png","language":"Go","funding_links":["https://ko-fi.com/mmalcek'"],"categories":[],"sub_categories":[],"readme":"# basicToOauth \n\n## HTTP proxy service that transforms a basic authorisation header to an OAuth 2.0 Bearer token. \n- Designed for Exchange Web Services (EWS) but it may work also with other services that require OAuth 2.0 Bearer token.\n- This application is for HTTP protocol only (not SMTP, POP3, IMAP). \n\n\nFrom 01.10.2022 the basic authentication will be deprecated by Microsoft for many services. \nThis package provides a simple way to migrate from basic authentication to OAuth by creating a proxy service.\n\n- Application gets basic header and transform it to OAuth header. Rest of the request is passed to the target service unchanged.\n- Application has been created mainly for Exchange Web Services (EWS) but it should work also with other services.\n\n## You can download Windows version from here:\nhttps://github.com/mmalcek/basicToOauth/releases\n\u003cbr /\u003e\n[Direct Windows download link](https://github.com/mmalcek/basicToOauth/releases/download/v1.0.3/basicToOauth_Windows_amd64_1-0-3.zip)\n\u003cbr /\u003e\nNote: Currently only Windows and Linux (64bit) prebuild binaries are available. I can build binaries for other platforms on request.\n\n\n### Configuration (config.yaml):\n```YAML\nhost: \"127.0.0.1\" # Host of the proxy service\nport: \"8085\" # Port of the proxy service\nclient_id: \"yourAzureClientID\" # Azure App registration client ID\ntenant_id: \"yourAzureTenantID\" # Azure tenant ID\nproxy_url: \"https://outlook.office365.com\" # URL of the target service\nauthority_url: \"https://login.microsoftonline.com/\" # URL of the authority service\nscopes:\n  - \"https://outlook.office365.com/EWS.AccessAsUser.All\" # Scopes for the target service\n```\nhost 127.0.0.1 is HIGHLY RECOMMENDED because comunication between proxy service and your application is not encrypted. In other words, basicToOauth app should be on the same machine as your application.\n\n\n### Installation options:\n1. You can just start the application and watch communication in command line.\n2. Or install as SERVICE - Open command line as administrator and run: \n    - **.\\basicToOauth.exe -service install**\n    - **.\\basicToOauth.exe -service start**\n    - **.\\basicToOauth.exe -service stop**\n    - **.\\basicToOauth.exe -service uninstall**\n\nOnce the application is running, you can use it in your application so instead \"https://outlook.office365.com/...\" just use \"http://127.0.0.1:8085/...\"\n\n**btw: If you like this app you can buy me a coffe ;)**\n\n\u003ca href='https://ko-fi.com/mmalcek' target='_blank'\u003e\n\t\u003cimg height='30' style='border:0px;height:40px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\n\u003c/a\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n### Setup Azure \"App Registration\"\n[MS topic - Authenticate an EWS application by using OAuth](https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth)\n\nShort version:\n1. Azure portal -\u003e Azure Active Directory -\u003e App registrations -\u003e New registration\n    - Add Name (e.g. MyApp)\n    - Accounts in this organizational directory only (.... - Single tenant)\n    - Public client/native https://login.microsoftonline.com/common/oauth2/nativeclient\n    - Register\n\n2. Azure portal -\u003e Azure Active Directory -\u003e App registrations -\u003e MyApp -\u003e Authentication\n    - Redirect URIs\n        - https://login.microsoftonline.com/common/oauth2/nativeclient (should be already there)\n    - Advanced settings \n        - Allow public client flows -\u003e Yes (IMPORTANT)\n\n3. Azure portal -\u003e Azure Active Directory -\u003e App registrations -\u003e MyApp -\u003e Manifest\n    - Add the following to the manifest - section \"requiredResourceAccess\"\n```JSON\n\t\t{\n\t\t\t\"resourceAppId\": \"00000002-0000-0ff1-ce00-000000000000\",\n\t\t\t\"resourceAccess\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"3b5f3d61-589b-4a3c-a359-5dd4b5ee5bd5\",\n\t\t\t\t\t\"type\": \"Scope\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\n```\nSo it should looks like:        \n```JSON\n\"requiredResourceAccess\": [\n\t\t{\n\t\t\t\"resourceAppId\": \"00000002-0000-0ff1-ce00-000000000000\",\n\t\t\t\"resourceAccess\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"3b5f3d61-589b-4a3c-a359-5dd4b5ee5bd5\",\n\t\t\t\t\t\"type\": \"Scope\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"resourceAppId\": \"00000003-0000-0000-c000-000000000000\",\n\t\t\t\"resourceAccess\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"e1fe6dd8-ba31-4d61-89e7-88639da4683d\",\n\t\t\t\t\t\"type\": \"Scope\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n```\n\n4. Azure portal -\u003e Azure Active Directory -\u003e App registrations -\u003e MyApp -\u003e Api permissions\n    Click on \"Grant admin consent for \"yourTenantName\"\n\n5. Azure portal -\u003e Azure Active Directory -\u003e App registrations -\u003e MyApp -\u003e Overview\n    - COPY \"Application (client) ID\" to basicToOauth app config.yaml to client_id: \"YOUR_CLIENT_ID\"\n    - COPY \"Directory (tenant) ID\" to basicToOauth app config.yaml to tenant_id: \"YOUR_TENANT_ID\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmalcek%2Fbasictooauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmalcek%2Fbasictooauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmalcek%2Fbasictooauth/lists"}