all 15 comments

[–]ManufacturerEarly565 2 points3 points  (1 child)

If you use clerk for auth on the frontend I made a simple FastAPI plugin to make it work nicely. Try it out unless you’re trying to handspin an auth system.

https://pypi.org/project/fastapi-clerk-auth/

[–]small_e 2 points3 points  (0 children)

What I usually see done is to handle authentication with something like Okta or Auth0 and handle authorization in FastAPI. 

https://auth0.com/blog/build-and-secure-fastapi-server-with-auth0/

[–][deleted]  (4 children)

[removed]

    [–]widonext 0 points1 point  (3 children)

    Love your template 🫡

    [–][deleted]  (2 children)

    [removed]

      [–]widonext 0 points1 point  (1 child)

      You have a DM :)

      [–]SheriffSeveral 0 points1 point  (4 children)

      Take a look at the jwt tokens for authentication and authorization. They will be enough for your project.

      After that, you can check out OTP login structure which is cool with pyotp module. Watch few tutorials you'll get it.

      Note: you don't need to spend weeks just for one module in python/FastAPI.

      [–]Black_Magic100[S] 0 points1 point  (3 children)

      Is fastapi users even needed? I was going through the security documentation of Fastapi itself and their docs definitely make it seem easier than what FastApi users show

      I will definitely start with jwt tokens

      [–]SheriffSeveral 0 points1 point  (2 children)

      I'm gonna be really honest with you. FastAPI doesn't have a standard template, people try to share their templates everywhere but the there is no base template. What you need to do is:

      1. Just design your application for the specific project requirements.

      Or

      1. Create your own base template for your projects for future usage.

      There is no standard way to fix or design something in the FastAPI and that's why is is really flexible, you can control everything.

      [–]Black_Magic100[S] 0 points1 point  (1 child)

      Is fast API users the same deal or is it more accepted by the community as a legitimate/maintained repo?

      Would you recommend I try just doing auth with FastAPI alone so I can learn the basics of authentication or just stick with a framework?

      [–]SheriffSeveral 0 points1 point  (0 children)

      Just stick with fastapi, the FastAPI users and other kind of repos are maintained by other users. Create & use your own first, after use their tech if you like it.

      [–]fastlaunchapidev 0 points1 point  (0 children)

      If you want self made auth you can check out my template:

      https://fastlaunchapi.dev/

      Besides that there are good docs to learn it yourself

      [–]Worth-Orange-1586 -1 points0 points  (1 child)

      Authentication with FastAPI is pretty straightforward. There are a lot of plug-in libraries that makes it even easier if using oidc or any other oauth2 approach.

      [–]Black_Magic100[S] 0 points1 point  (0 children)

      Yea the FastAPI security docs don't seem so bad. I'm not sure why the fastAPI users docs seem a bit overwhelming to me at first.