Skip to content

JSONDecodeError when running the identity sample app #148

Closed

Description

@mattrochford

Hello,

I am working on a streamlit web app in Python that will be running on an EC2 instance. I am trying to set up SSO for our organization using Azure AD B2C and have been following the steps listed here:

https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-python-web-app?tabs=windows

I have no issues with the first 4 steps but am running into an issue for step 5 when I try to run the sample web app. After executing 'python -m flask run --host localhost --port 5000' I receive a JSONDecodeError that looks like this:

image

I ran this both on an EC2 instance and on my local machine and each time the exact same error was produced. Can someone please point me in the right direction to get this working? Thank you

Activity

  1. rayluo commented on May 24, 2024

    @rayluo
    Contributor

    Can you double check your configuration in .env to see whether you defined a REDIRECT_URI?

  2. mattrochford commented on May 24, 2024

    @mattrochford
    Author

    Can you double check your configuration in .env to see whether you defined a REDIRECT_URI?

    Hi Ray,

    Thank you so much for the quick response. This fixed everything right away. I do now see that in .env.sample.b2c the REDIRECT_URI is included but in the guide that I originally linked it is not. Perhaps it would be helpful to include it in the guide as well. Thanks again for your help and have a nice weekend.

    Best,
    Matt

  3. rayluo commented on May 26, 2024

    @rayluo
    Contributor

    FYI: Upgrade an underlying library by pip install -U identity to get its 0.8.1 version, and you will see a nicer error message when/if you forget to configure redirect_uri for your B2C authority.

    Login Failure
    configuration_error
    This authority does not support device code flow. Please configure a redirect_uri to use auth code flow.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions