Summary
This release ships a new Auth utility in alpha, with two pieces: a JWT verifier to protect your APIs and an OAuth2 client to call APIs protected by someone else. It also fixes a handful of bugs across Data Classes, Streaming, Idempotency, Event Handler, Metrics and Feature Flags.
A special thank you to @bfreiberg for the outstanding work on both Auth utilities. They helped and implemented them, wrote the docs and tested it.
Welcome also to our other new contributors @Om-singhaI, @Shubham-Padkonde, @chancesong10 and @chiruu12. Thank you for the reports, the fixes and the patience during reviews.
JWT verification (alpha)
You can now verify access tokens with JWTVerifier. It fetches and caches the issuer's JWKS, selects the signing key, and checks signature, issuer, audience, expiration and any claim you require. Only asymmetric algorithms are accepted, and errors never include token material.
from aws_lambda_powertools.event_handler import APIGatewayHttpResolver
from aws_lambda_powertools.utilities.auth_alpha import JWTVerifier
app = APIGatewayHttpResolver()
verifier = JWTVerifier(
issuer="https://idp.example.com",
audience="https://orders.example.com",
algorithms=["RS256"],
required_claims=["sub"],
)
@app.get("/orders", middlewares=[verifier.require(scopes=["orders:read"])])
def list_orders():
return {"subject": app.context["claims"]["sub"]}The middleware returns 401 for missing or invalid tokens and 403 for missing scopes. You can also call verifier.verify(token) directly, use verifier.authorize(event) inside an API Gateway Lambda authorizer, or start from JWTVerifier.cognito() for Amazon Cognito access tokens.
Install it with pip install "aws-lambda-powertools[jwt]". Thank you @bfreiberg for building this with us.
OAuth2 client credentials (alpha)
You can now call downstream APIs protected by OAuth2 with OAuth2Client. It exchanges your client credentials for a bearer token, caches it, and refreshes it before it expires. Pass the client secret as a callable and it is loaded on every exchange, so it can come straight from Secrets Manager.
from aws_lambda_powertools.utilities.auth_alpha import OAuth2Client
inventory_api = OAuth2Client(
token_url="https://idp.example.com/token",
client_id="orders-service",
client_secret=load_secret,
scopes=["inventory:read"],
)
response = inventory_api.request("GET", "https://inventory.example.com/stock/sku-123")Use auth_headers() instead if you want only the Authorization header for your own HTTP client.
Install it with pip install "aws-lambda-powertools[oauth2]".
Both utilities live under auth_alpha while we collect feedback, so the API may change before GA. Pin your Powertools version if you use them in production. They are included in the Lambda layer.
Changes
- fix(data-classes): handle keyword arguments in CaseInsensitiveDict.update (#8518) by @chiruu12
- fix(data-classes): keep the value of large DynamoDB numbers (#8513) by @chiruu12
- fix(streaming): return empty bytes when reading at the end of an S3 object (#8511) by @chancesong10
- test(kafka): cover custom serializer output variants (#8499) by @leandrodamascena
- fix(metrics): preserve string default dimensions across instances (#8404) by @ericbn
- fix(idempotency): apply jmespath_options to payload_validation_jmespath (#8474) by @Om-singhaI
- fix(event_handler): skip compression when the response has no body (#8485) by @Om-singhaI
📜 Documentation updates
- fix(layer): remove urllib3 from the Lambda layer again (#8556) by @leandrodamascena
- chore(deps): bump urllib3 from 2.7.0 to 2.8.0 in /docs (#8533) by @dependabot[bot]
- chore(deps): bump gitpython from 3.1.59 to 3.1.62 (#8531) by @dependabot[bot]
- feat(auth): add OAuth2 client credentials support (alpha) (#8486) by @bfreiberg
- chore(deps): bump mkdocs-llmstxt from 0.2.0 to 0.5.0 (#8507) by @dependabot[bot]
- ci: replace poetry with uv (#7910) by @leandrodamascena
- fix(idempotency): serialize UUID and datetime fields in dataclass payloads (#8501) by @Om-singhaI
- feat(event_handler): add opt-in ALB response size validation (#8490) by @leandrodamascena
- fix(feature_flags): warn on comparator evaluation errors (#8470) by @Shubham-Padkonde
- feat(auth): add JWT verification and API Gateway authorization (#8469) by @bfreiberg
- chore(deps): bump soupsieve from 2.8.4 to 2.9 in /docs (#8471) by @dependabot[bot]
🔧 Maintenance
- fix(layer): remove urllib3 from the Lambda layer again (#8556) by @leandrodamascena
- chore(deps-dev): bump types-requests from 2.33.0.20260906 to 2.33.0.20261006 (#8552) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1143.0 to 2.1145.0 in the aws-cdk group (#8547) by @dependabot[bot]
- chore(deps-dev): bump nox from 2026.4.10 to 2026.8.17 (#8551) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.272.0a0 to 2.273.0a0 (#8550) by @dependabot[bot]
- chore(deps): bump the github-actions group with 8 updates (#8549) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.16.10 to 0.17.0 in the dev-dependencies group across 1 directory (#8553) by @dependabot[bot]
- chore(deps-dev): bump sentry-sdk from 2.70.0 to 2.71.0 (#8554) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 7.7.0 to 7.9.0 in the github-actions group (#8521) by @dependabot[bot]
- chore(deps-dev): bump the dev-dependencies group across 1 directory with 3 updates (#8526) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.266.0a0 to 2.272.0a0 (#8529) by @dependabot[bot]
- chore(deps-dev): bump protobuf from 7.35.1 to 7.36.2 (#8528) by @dependabot[bot]
- chore(deps-dev): bump urllib3 from 2.7.0 to 2.8.0 in /layer_v3 (#8532) by @dependabot[bot]
- chore(deps): bump urllib3 from 2.7.0 to 2.8.0 in /docs (#8533) by @dependabot[bot]
- chore(deps): bump pyjwt from 2.15.0 to 2.15.1 (#8530) by @dependabot[bot]
- chore(deps): bump gitpython from 3.1.59 to 3.1.62 (#8531) by @dependabot[bot]
- chore(deps): bump cryptography from 50.0.1 to 50.0.2 (#8527) by @dependabot[bot]
- feat(auth): add OAuth2 client credentials support (alpha) (#8486) by @bfreiberg
- chore(deps): bump mkdocs-llmstxt from 0.2.0 to 0.5.0 (#8507) by @dependabot[bot]
- chore(deps): bump datadog-lambda from 8.122.0 to 8.128.0 (#8503) by @dependabot[bot]
- chore(deps-dev): bump types-requests from 2.33.0.20260712 to 2.33.0.20260906 (#8505) by @dependabot[bot]
- chore(deps): bump pydantic-settings from 2.14.2 to 2.15.0 (#8504) by @dependabot[bot]
- chore(deps): bump pyjwt from 2.14.0 to 2.15.0 (#8506) by @dependabot[bot]
- ci: replace poetry with uv (#7910) by @leandrodamascena
- chore(deps): bump the github-actions group with 2 updates (#8497) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1142.0 to 2.1143.0 in the aws-cdk group (#8491) by @dependabot[bot]
- chore(deps-dev): bump ty from 0.0.49 to 0.0.84 (#8498) by @dependabot[bot]
- chore(deps-dev): bump types-protobuf from 7.34.1.20260518 to 7.35.1.20260906 (#8495) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.16.8 to 0.16.9 in the dev-dependencies group across 1 directory (#8493) by @dependabot[bot]
- chore(deps-dev): bump sentry-sdk from 2.63.0 to 2.70.0 (#8496) by @dependabot[bot]
- chore(deps-dev): bump filelock from 3.29.7 to 4.0.3 (#8494) by @dependabot[bot]
- chore(deps-dev): bump the dev-dependencies group across 1 directory with 2 updates (#8478) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.1141.0 to 2.1142.0 in the aws-cdk group (#8477) by @dependabot[bot]
- chore(deps): bump pydantic from 2.13.4 to 2.13.5 (#8479) by @dependabot[bot]
- feat(auth): add JWT verification and API Gateway authorization (#8469) by @bfreiberg
- chore(deps): bump the github-actions group with 5 updates (#8481) by @dependabot[bot]
- chore(deps): bump anyio from 4.12.1 to 4.14.2 (#8475) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.43.92 to 1.43.97 (#8480) by @dependabot[bot]
- chore(deps): bump typing-extensions from 4.15.0 to 4.16.0 (#8482) by @dependabot[bot]
- chore(deps): bump soupsieve from 2.8.4 to 2.9 in /docs (#8471) by @dependabot[bot]
- chore(deps-dev): bump soupsieve from 2.8.4 to 2.9 (#8472) by @dependabot[bot]
This release was made possible by the following contributors:
@bfreiberg, @chancesong10, @chiruu12, @ericbn, @leandrodamascena, @Om-singhaI, @Shubham-Padkonde, @dependabot[bot] and @claude