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] How to access user attributes #61

Closed
martin-greentrax opened this issue Mar 30, 2022 · 6 comments
Closed

[Documentation] How to access user attributes #61

martin-greentrax opened this issue Mar 30, 2022 · 6 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@martin-greentrax
Copy link

This crucial part is missing in the documentation.
based on: #8 (comment)

Here a stub that could help:

You can access the authorized user's attributes with request.state.user
A sample view that outputs the current user name:

from fastapi import Request, Security

@app.get("/hello", dependencies=[Security(azure_scheme)])
async def hello(request: Request):
    return "Hello {}".format(request.state.user.name)
@martin-greentrax martin-greentrax added the question Further information is requested label Mar 30, 2022
@JonasKs
Copy link
Member

JonasKs commented Mar 30, 2022

Hi, I agree!

based on: #8 (comment)

Hehe, yes, I knew there would be questions back then and then I forgot about it.

I also got a question about it here.

Would you like to contribute with a pull request? 😊

We could move these two sites (1, 2) which are equal and then create a new section that's called something like Usage which has questions and answers like these?

@martin-greentrax
Copy link
Author

I'm happy to contribute, I actually tried but currently don't have the time to get familiar with Docusaurus and don't want to mess up the page structure

@JonasKs
Copy link
Member

JonasKs commented Mar 30, 2022

No worries. I'll leave this open for someone if they want to contribute for a few days, and if not, I'll do it. Thank you for reminding me!

@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 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

I've added documentation here and moved the pages as suggested above.

@JonasKs JonasKs closed this as completed Apr 4, 2022
@martin-greentrax
Copy link
Author

Thank you, @JonasKs
I m sure it will help people getting on board.

@JonasKs
Copy link
Member

JonasKs commented Apr 4, 2022

😊 Also added a bunch of new pages if you'd like to check them out under the same section, such as how to use Graph and how to call your APIs from Python 🎉

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

2 participants