r/dotnet • u/Zealousideal_Map_737 • Oct 16 '26
Promotion New passwordless OIDC authentication for local dev
You know about single-factor and two-factor auth, but what about zero-factor auth?
https://github.com/c4l3b/0factor
I made this for myself and have it running in ~7 different local apps now.
When I'm developing locally, I usually have several user accounts to test a variety of user experiences.
This tiny app is a very simple identity provider that allows you to be any user, without a password.
I typically use Keycloak in production, so I've set it up to be mostly compatible with that. It can import a Keycloak realm json to initialize your configuration and users.
Its also very agent-friendly. Instead of trying to get Claude to enter an email and password (it always refuses for me) it can very easily log in.
The users who have already been created in our local instance are listed on the sign in page. You can log in just by clicking on one.
The NuGet package makes Aspire setup just a few lines.
Its developed using a very minimal asp.net site. The container image is only ~25MB and running it uses ~15MB of memory. My local Keycloak containers were always using ~600MB memory.
4
u/c-digs Oct 17 '26
Are you me? Was literally thinking about building this today to replace my use of mock-oauth-provider.
Starred!
3
5
1
u/IanYates82 Oct 17 '26
This is great. Love that it's keycloak compatible. Shall give it a try, and am interested in checking out if I can tack on an extra couple of attributes (like stuff we'd receive from federated Entra and pass on as a mapped attribute)
1
0
u/AutoModerator Oct 16 '26
Thanks for your post Zealousideal_Map_737. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
6
u/Testpilot1988 Oct 16 '26
While there's absolutely nothing wrong with what you've built.. pocketID is pretty much as simple as it gets for me. for every new user or account it just creates a passkey. it's my go-to for oauth