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
Can you have fake provider custom data with auto setup? #207
Comments
yay for me 😢 I'll try and see what I can dig out to see what i did 😁 |
@fpw23 Yo - ok, I've got something for ya. You said you're using Nancy (yay) so here's some nancy code for you.
route format:
Now the magic that connects the two is that the html route link needs to be the same name as the fake provider.... EDIT The reason why this works is that the The internal dictionary is So, back to the code I've suggested you add to your startup stuff. When you try an manually add the fakeProviders, the Lazy dictionary kicks off .. tries to discover any providers (which is normal) .. then finishes that .. and now adds your OWN fake ones... which it stores in a static. And viola! you can now pretend to goto one of these fake ones. |
Sweet! It works.... Thank you so much for such an awesome library. And double thanks for explaining the magic, it would have taken forever for me to figure that out. |
@fpw23 as tax .. can I request a tiny PR to a wiki file somewhere ? (i know i'm pushing my luck .. but doesn't hurt to ask) |
@PureKrome well worth the payment :) I will do a blog post in the next month or so and link it here when I am done. |
@PureKrome so when I first read your last response I assumed PR meant "Public Relations" as in try to promote SimpleAuthenication on the web somewhere but now that I read it again it sounds like you want to me update the wiki here on github (PR == Pull Request)? |
:) yeah. a pull request to add a few lines to a wiki in this repo, somewhere. |
Following the docs page on fake providers I was able to get my nancy fx app working with fake provider logins but now I want to control the data that is being returned. Can I do this when using auto setup?
As far as I can tell I need to register an IFakeAuthenticationProvider but I don't see a way to access the provider factory that is being used in the SimpleAuthenticationModule that comes with nancy auto setup.
The text was updated successfully, but these errors were encountered: