Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ services:
UPSTREAM_URL: ${UPSTREAM_URL:-http://stac:8001}
OIDC_DISCOVERY_URL: ${OIDC_DISCOVERY_URL:-http://localhost:8888/.well-known/openid-configuration}
OIDC_DISCOVERY_INTERNAL_URL: ${OIDC_DISCOVERY_INTERNAL_URL:-http://oidc:8888/.well-known/openid-configuration}
AUDIENCE: ${AUDIENCE}


env_file:
- path: .env
required: false
Expand Down
8 changes: 8 additions & 0 deletions docs/user-guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ The application is configurable via environment variables.
**Required:** No, defaults to the value of `OIDC_DISCOVERY_URL`
**Example:** `http://auth/.well-known/openid-configuration`

### `AUDIENCE`

: The unique identifier of your API resource server

The AUDIENCE environment variable specifies the intended recipient of OAuth2 access tokens. This value represents the unique identifier of your API resource server and must match the `aud` (audience) claim present in incoming OAuth2 access tokens. If undefined the API will not impose a check on the `aud` claim

OAuth2 Audience Claim

### `DEFAULT_PUBLIC`

: Default access policy for endpoints
Expand Down
1 change: 1 addition & 0 deletions src/stac_auth_proxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ async def lifespan(app: FastAPI):
private_endpoints=settings.private_endpoints,
default_public=settings.default_public,
oidc_discovery_url=settings.oidc_discovery_internal_url,
allowed_jwt_audiences=settings.audience,
)

if settings.root_path or settings.upstream_url.path != "/":
Expand Down
1 change: 1 addition & 0 deletions src/stac_auth_proxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Settings(BaseSettings):
upstream_url: HttpUrl
oidc_discovery_url: HttpUrl
oidc_discovery_internal_url: HttpUrl
audience: Optional[str] = None

root_path: str = ""
override_host: bool = True
Expand Down
1 change: 1 addition & 0 deletions src/stac_auth_proxy/middleware/EnforceAuthMiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def validate_token(
detail="Not enough permissions",
headers={"WWW-Authenticate": f'Bearer scope="{scope}"'},
)

return payload

@property
Expand Down
Loading