Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWKS URL Parsing Fails [v24.0.5] #9272

Open
matt2102 opened this issue Jan 9, 2025 · 2 comments
Open

JWKS URL Parsing Fails [v24.0.5] #9272

matt2102 opened this issue Jan 9, 2025 · 2 comments
Labels

Comments

@matt2102
Copy link

matt2102 commented Jan 9, 2025

JWKS URL Parsing

Updating schema over /admin/endpoint with a dash separated subdomain fails and results in the below error.

{
    "errors": [
        {
            "message": "resolving updateGQLSchema failed because invalid character 'p' after top-level value (Locations: [{Line: 3, Column: 4}])",
            "extensions": {
                "code": "Error"
            }
        }
    ]
}

The following url would work in v23 and migrating to v24.0.5 schema validation threw an error:

# Dgraph.Authorization {"jwkurl": "https://dash-seperated-subdomain-api.example.com/.well-known/jwks"}

To Reproduce

Add a subdomain such as to the schema.graphql file and update the schema over the /admin/schema endpoint.

# Dgraph.Authorization {"jwkurl": "https://dash-seperated-subdomain-api.example.com/.well-known/jwks"}

this behavior is the same when using multiple urls as in

# Dgraph.Authorization {"jwkurls": ["https://dash-seperated-subdomain-api.example.com/.well-known/jwks"]}
@matt2102 matt2102 added the bug label Jan 9, 2025
@drev74
Copy link

drev74 commented Feb 9, 2025

This config is invalid, since the jwkurls must pointer to the actual json. Below is a valid example, that works for me:

Dgraph.Authorization {"header":"X-Dgraph-AuthToken","namespace":"https://dgraph.io/jwt/claims","jwkurl":"https://my-provider.com/.well-known/jwks.json","audience":["mycorp","dgraph"],"closedbydefault":true}

@matt2102
Copy link
Author

Yes, the endpoint must return valid JSON Web Keys however including the .json file extension at the end is unnecessary.

See Google's implementation of the JWKS url https://www.googleapis.com/oauth2/v3/certs

The problem still remains that a subdomain with too many dashes somehow fails JWK url parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants