Skip to content

cognito: "Validation Error for Claims" - when using custom attributes in cognito #72

@JustinGuese

Description

@JustinGuese

Hey,
I just can't get cognito to work with this library...
I am using the second example

def secure_access(current_user: AccessUser = Depends(auth.claim(AccessUser))):
    # access token is valid and getting user info from access token
    return f"Hello", {current_user.sub}

with the example

class AccessUser(BaseModel):
    sub: str

But as soon as I add custom attributes that are set in my cognito pool, like "email" or "family_name", it throws the error
"Validation Error for Claims"

How can I add custom attributes to grab them like current_user.family_name ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions