SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
714 stars 108 forks source link

Authentication centralised #149

Closed Immortalin closed 5 years ago

Immortalin commented 5 years ago

Rails has Devise, Phoenix has Pow. Authentication/authorization are dangerous wheels for users to reinvent. A centralised system/generator for managing email sign-up, confirmation, reset, multi factor U2F authentication, token/claims based Auth etc. is important. Most of the functionality are already there in ASP.net core, just need to wrap it in a fancier API.

Krzysztof-Cieslak commented 5 years ago

Saturn (and Giraffe) are based on ASP.NET Core which means that your more than welcome to use standard ASP.NET Core components, and configuration. Also, from what I can tell, it's standard usage pattern of Giraffe/Saturn users - one of the big selling points of those libraries is integration with ASP.NET Core.

Also, our current helpers for authentication (like use_jwt_authentication and all friends) are using internally ASP.NET Core - we don't invent anything on our own. I can agree that not everything is ported to the fancy Saturn API, but many of the things probably won't ever be ported - just due to share size of ASP.NET Core, and the fact that it's fairly easy to write your own wrapper if necessary (for example https://github.com/SaturnFramework/Saturn/blob/master/src/Saturn.Extensions.HttpSys/Saturn.HttpSys.fs has been contributed by user after he created this implementation in his work project).

And, ofc, I'd be happy to accept PRs adding specific APIs that you think are missing to Saturn.

Immortalin commented 5 years ago

Think you can do a guide on basic user signup + email confirmation workflow? I mean that's pretty much necessary for every app with a login functionality short of going full 3rd party Oauth.

Immortalin commented 5 years ago

E.g. https://dev.to/eliasjpr/recipebuilding-an-amber-authentication-system-517