fastapi-azure-auth
fastapi-azure-auth copied to clipboard
[BUG] got claim `acct` in type `int`, but fastapi-azure-auth is waiting for `str`
trafficstars
With lastest version of FastAPI and Pydantic, When I got an access token from Azure, in the claims, the value for acct is a int to 0, but fastapi-azure-auth is waiting for str, could you please fix that:
https://github.com/Intility/fastapi-azure-auth/blob/52073693e1b59340d1e040b384b957dc61db0fd3/fastapi_azure_auth/user.py#L90
user: User = User(
**{**token, 'claims': token, 'access_token': access_token, 'is_guest': user_is_guest}
)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/xxx/.venv/lib/python3.11/site-packages/pydantic/main.py", line 171, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for User
acct
Input should be a valid string [type=string_type, input_value=0, input_type=int]
For further information visit https://errors.pydantic.dev/2.6/v/string_type
Azure doc: https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims-reference#v10-and-v20-optional-claims-set