{"id":26164700,"url":"https://github.com/optum/azure-functions-auth","last_synced_at":"2026-04-24T19:33:14.061Z","repository":{"id":57288025,"uuid":"523502288","full_name":"Optum/azure-functions-auth","owner":"Optum","description":"TypeScript package for adding OAuth2 to Azure Functions","archived":false,"fork":false,"pushed_at":"2023-02-16T19:55:44.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-08T15:16:39.978Z","etag":null,"topics":["azure-functions","oauth2"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Optum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2022-08-10T21:30:24.000Z","updated_at":"2023-03-24T19:15:42.000Z","dependencies_parsed_at":"2022-09-19T17:30:26.755Z","dependency_job_id":null,"html_url":"https://github.com/Optum/azure-functions-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fazure-functions-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fazure-functions-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fazure-functions-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Optum%2Fazure-functions-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Optum","download_url":"https://codeload.github.com/Optum/azure-functions-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243060976,"owners_count":20229897,"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-functions","oauth2"],"created_at":"2025-03-11T15:39:43.565Z","updated_at":"2026-04-24T19:33:14.033Z","avatar_url":"https://github.com/Optum.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure-functions-auth\n\nAn easy way to wrap Azure Functions in automatic OAuth2 JWT authorization!\n\nThis library will wrap any javascript/typescript Azure Function implementation and automatically provide access to \nthe JwtToken that was included on the request.  If the auth requirements weren't met, 401/403 responses are \nautomatically sent back.\n\nExamples:\n# Require a JWT token with no role requirements\n\n```typescript\nimport { requireAuthorization, AuthenticatedContext } from \"@optum/azure-functions-auth\"\n\nconst httpTrigger: AzureFunction = requireAuthorization(async (context: AuthenticatedContext, req: HttpRequest): Promise\u003cvoid\u003e =\u003e {\n    context.log(\"Received request from subject\", context.jwtToken.sub)\n}, {\n    jwksEndpoint: process.env.JWKS_ENDPOINT,        // configurable based on your OAuth2 provider\n    requiredIssuer: process.env.REQUIRED_ISSUER,    // configurable based on your OAuth2 provider\n    requiredAud: process.env.REQUIRED_AUD           // the specific audiance value for your service\n})\n\nexport default httpTrigger\n```\n\n# Require a JWT token with additional role requirements\n\n```typescript\nimport { requireAuthorization, AuthenticatedContext } from \"@optum/azure-functions-auth\"\n\nconst httpTrigger: AzureFunction = requireAuthorization(async (context: AuthenticatedContext, req: HttpRequest, token: JwtToken): Promise\u003cvoid\u003e =\u003e {\n    context.log(\"Received request from subject\", context.jwtToken.sub)\n}, {\n    jwksEndpoint: process.env.JWKS_ENDPOINT,        // configurable based on your OAuth2 provider\n    requiredIssuer: process.env.REQUIRED_ISSUER,    // configurable based on your OAuth2 provider\n    requiredAud: process.env.REQUIRED_AUD,          // the specific audiance value for your service\n    requiredRole: \"MY_FUNCTION_ROLE\"                // the role guarding access to this specific function endpoint\n})\n\nexport default httpTrigger\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptum%2Fazure-functions-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptum%2Fazure-functions-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptum%2Fazure-functions-auth/lists"}