https://github.com/voiceflip-technologies-inc/functionapp-oauth-vf
oAuth Azure Function App for VoiceFlip
https://github.com/voiceflip-technologies-inc/functionapp-oauth-vf
api azure azure-function function login oauth signing
Last synced: 4 months ago
JSON representation
oAuth Azure Function App for VoiceFlip
- Host: GitHub
- URL: https://github.com/voiceflip-technologies-inc/functionapp-oauth-vf
- Owner: Voiceflip-Technologies-Inc
- Created: 2025-09-17T23:23:09.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-10-01T02:33:27.000Z (5 months ago)
- Last Synced: 2025-10-01T03:24:12.820Z (5 months ago)
- Topics: api, azure, azure-function, function, login, oauth, signing
- Language: Python
- Homepage:
- Size: 725 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VoiceFlip Authentication (Azure Functions – Zendesk OAuth)
Minimal authentication framework for integrating with Zendesk using Azure Functions .NET 8 Isolated. Exposed endpoints for:
- Authorization code flow (interactive) with /api/oauth/start → /api/oauth/callback.
- Client credentials flow (machine-to-machine) with /api/oauth/token/client.
- Token verification with /api/oauth/test.
The functions are implemented in OAuthFunctions.cs using Microsoft.Azure.Functions.Worker + Worker.Extensions.Http.
The host startup is in Program.cs with top-level declarations.
The HTTP/host configuration is in host.json.
## Endpoints
- `GET /api/oauth/start`
Redirect to Zendesk (`/oauth/authorizations/new`) with `client_id`, `redirect_uri`, `scope` and `state`.
- `GET /api/oauth/callback?code=...&state=...`
Exchange `code` for `access_token` in `POST /oauth/tokens`. Displays the **masked** token in HTML.
- `GET|POST /api/oauth/token/client` _(AuthorizationLevel.Function)_
Request an **access_token** via `client_credentials` (`POST /oauth/tokens`). Requires `?code=`.
- `GET /api/oauth/test?token=...` _(AuthorizationLevel.Function)_
Call `GET /api/v2/oauth/tokens/current.json` with `Authorization: Bearer ` to verify it. Requires `?code=`.
> Function names are: `StartAuth`, `OAuthCallback`, `ClientCredentialsToken`, `TestToken`.
## Configuration Variables
See **Application Settings** (Azure) or `local.settings.json` (local only):
- `ZENDIESK_BASE_URL` — e.g., `https://support.doorifymls.com`
- `ZENDIESK_CLIENT_ID` — e.g., `voiceflip-doorify`
- `ZENDESK_CLIENT_SECRET` — **client secret** (store in Key Vault)
- `REDIRECT_URI` — `https://.azurewebsites.net/api/oauth/callback`
- `SCOPES` — `read and write` (adjust as needed)
> In **Flex Consumption**, `FUNCTIONS_WORKER_RUNTIME` is not defined in Azure. You can use `dotnet-isolated` locally.
## Requirements
- .NET 8 SDK
- Visual Studio 2022 (or VS Code)
- Azurite (for `UseDevelopmentStorage=true`) or a storage account if running locally with real AzureWebJobsStorage.
## Local execution
1. Create `local.settings.json` (not published to Azure):
```json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"ZENDESK_BASE_URL": "https://support.doorifymls.com",
"ZENDESK_CLIENT_ID": "voiceflip-doorify",
"ZENDESK_CLIENT_SECRET": "REPLACE",
"REDIRECT_URI": "https://voiceflip-auth.azurewebsites.net/api/oauth/callback",
"SCOPES": "read write"
}