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

[Documentation]: Suggested update in walkthrough #45

Closed
bkmetzler opened this issue Jan 13, 2022 · 8 comments
Closed

[Documentation]: Suggested update in walkthrough #45

bkmetzler opened this issue Jan 13, 2022 · 8 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@bkmetzler
Copy link
Contributor

Describe the issue
(https://intility.github.io/fastapi-azure-auth/single-tenant/azure_setup#step-4---allow-openapi-to-talk-to-the-backend)

There should be one final step on this walk through. Azure has added another section under "Exposing an API" called "Authorized client applications". If you do not link the OpenAPI back to the original application, the end-user will be prompted to request consent from an administrator.

To Reproduce
Manually go through the Single Tenant walkthrough (https://intility.github.io/fastapi-azure-auth/single-tenant/). Once fully complete, any attempt to log into Azure via OpenAPI will send the end-user to a page, as described below:

Selection_030

Fix
This is so the end-user doesn't see this prompt.
1.) Go to "Expose an API" under your Sample application (not the OpenAPI).
2.) Under "Authorized client applications" click "Add a client application"

Selection_029

3.) Copy the Application Id from your 'Sample - OpenAPI' into the 'Client ID' field.
4.) Select the exposed 'api://*' check box
5.) Click "Add Application"

Now when you click "Authorize"/"Login" via SwaggerUI, the end user will no longer require Admin consent.

I hope this helps,
-Brian

@bkmetzler bkmetzler added the question Further information is requested label Jan 13, 2022
@h3rmanj
Copy link
Member

h3rmanj commented Jan 13, 2022

Hi, while authorized clients will skip consenting, it shouldn't be required.

Did you remember to check that users can consent as well when creating the scope?
image

@JonasKs
Copy link
Member

JonasKs commented Jan 24, 2022

@bkmetzler ? 😊

@bkmetzler
Copy link
Contributor Author

Yes, "Admins and users" is selected.
Selection_033

@h3rmanj
Copy link
Member

h3rmanj commented Jan 24, 2022

That's odd. Do you have control of the tenant? The only thing I can think of is that there might be a strict policy in place which don't allow users to consent anyway. I don't really know if that's possible though, but we have never encountered this in our tenant.

We could add a info box guiding the user to set up authorized client applications for the API, if they don't want the user to need to consent. But I don't think it should be a required step, as hitting the admin consent screen is not the normal behavior when user consent is enabled.

@JonasKs
Copy link
Member

JonasKs commented Jan 27, 2022

We're unable to reproduce this. Can you share some more information about your setup, @bkmetzler? Do you have prompt=admin in the redirect URI to Azure, signing in from a different tenant or something similar?

@bkmetzler
Copy link
Contributor Author

After looking into this, it seems to be a related to the fact I am using an enterprise level tenant with limitations at the tenant level.

There is no "prompt=admin" in the redirect URI.

@JonasKs
Copy link
Member

JonasKs commented Feb 9, 2022

Thank you for getting back to us, @bkmetzler!

I'd like to have a note in the docs which just links to this issue, for those who has issues with admin consent being asked for after following the tutorial. Would you like to create a PR, or should I do it? 😊

@JonasKs JonasKs changed the title [BUG/Question]: Suggested update in walkthrough [DOCUMENTATION]: Suggested update in walkthrough Mar 30, 2022
@JonasKs JonasKs added good first issue Good for newcomers documentation Improvements or additions to documentation and removed question Further information is requested labels Mar 30, 2022
@JonasKs JonasKs changed the title [DOCUMENTATION]: Suggested update in walkthrough [Documentation]: Suggested update in walkthrough Mar 30, 2022
@JonasKs JonasKs self-assigned this Apr 4, 2022
JonasKs added a commit that referenced this issue Apr 4, 2022
  - #62: Tutorial on how to use Python to interact with your APIs
  - #61: Tutorial on how to access user attributes in your APIs
  - #45: Added a page that explains how to solve admin consent when
    signing in. Thank you @bkmetzler
  - #40: Add tutorial on how to set up and use Graph APIs using the On
    Behalf Flow. Thank you @u-iandono & @h3rmanj
- Add graph endpoint example
JonasKs added a commit that referenced this issue Apr 4, 2022
  - #62: Tutorial on how to use Python to interact with your APIs
  - #61: Tutorial on how to access user attributes in your APIs
  - #45: Added a page that explains how to solve admin consent when
    signing in. Thank you @bkmetzler
  - #40: Add tutorial on how to set up and use Graph APIs using the On
    Behalf Flow. Thank you @u-iandono & @h3rmanj
- Add graph endpoint example
JonasKs added a commit that referenced this issue Apr 4, 2022
@JonasKs
Copy link
Member

JonasKs commented Apr 4, 2022

Thank you so much @bkmetzler. I've added documentation for this here.

@JonasKs JonasKs closed this as completed Apr 4, 2022
nikstuckenbrock pushed a commit to nikstuckenbrock/fastapi-azure-auth that referenced this issue Oct 16, 2023
  - Intility#62: Tutorial on how to use Python to interact with your APIs
  - Intility#61: Tutorial on how to access user attributes in your APIs
  - Intility#45: Added a page that explains how to solve admin consent when
    signing in. Thank you @bkmetzler
  - Intility#40: Add tutorial on how to set up and use Graph APIs using the On
    Behalf Flow. Thank you @u-iandono & @h3rmanj
- Add graph endpoint example
nikstuckenbrock pushed a commit to nikstuckenbrock/fastapi-azure-auth that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants