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

Custom Policy Not SUpported #41

Closed
simon-lighthouse opened this issue Aug 6, 2024 · 2 comments
Closed

Custom Policy Not SUpported #41

simon-lighthouse opened this issue Aug 6, 2024 · 2 comments
Assignees

Comments

@simon-lighthouse
Copy link

simon-lighthouse commented Aug 6, 2024

Describe the bug
I've followed the setup steps and set up my MSAL configuration as per reproduce steps to adda custom policy, but I am receiving a pydantic error:

pydantic_core._pydantic_core.ValidationError: 1 validation error for IDTokenClaims
tfp
  Input should be 'AAD_SINGLE', 'AAD_MULTI', 'B2C_1_LOGIN', 'B2C_1_PROFILE' or 'B2C_1A_LOGIN' [type=enum, input_value='B2C_1_signup_signin', input_type=str]      
    For further information visit https://errors.pydantic.dev/2.8/v/enum

To Reproduce
Steps to reproduce the behavior:

  1. Set up the client config with the following:
client_config: MSALClientConfig = MSALClientConfig()
client_config.client_id = os.getenv("CLIENT_ID")
client_config.client_credential = "The client_credential retrieved at step #1"
client_config.tenant = os.getenv("TENANT_ID")
client_config.b2c_policy = "B2C_1_signup_signin"
  1. Run the users/me endpoint

Expected behavior
This should return the users/me response correctly, but instead a pydantic error is thrown as above

Environment Settings

  • OS: [Windows]
  • Python Version: 3.12
  • Packages Versions: [msal 1.3 / fastapi 0.111.1 / fastapi_msal 2.15 / pydantic 2.8.2 ]
@dudil dudil self-assigned this Aug 7, 2024
@dudil
Copy link
Owner

dudil commented Aug 7, 2024

HI @simon-lighthouse
Thank you for finding this issue 🙏
I would resolve it and issue a new release with the fix

@dudil dudil mentioned this issue Aug 7, 2024
@dudil dudil closed this as completed in fca7675 Aug 7, 2024
dudil added a commit that referenced this issue Aug 7, 2024
@simon-lighthouse
Copy link
Author

Great fix, works perfectly! Your library is great!

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

No branches or pull requests

2 participants