-
Notifications
You must be signed in to change notification settings - Fork 78
FakeProvider
Create a link/button with the route: /authentication/redirect/fakePewPew
and that's it!
Pro Tip: you can have as many <a href=".../fake*" /> as you want on an html page.
This is a fake authentication provider which means you don't leave your website to authenticate. It redirects straight back at your site. By default, it will return some hardcoded Access Token and UserInformation data, but you can customise that to return custom data.
- Speed up testing time! No need to leave your site.
- So you are not dependant on the 3rd party site(s).
- Can test for certain scenarios, like if a piece of data is missing.
- Because you're not hitting the real authentication provider, you don't need to create an account with them to test out the service.
I love using it so I don't have to wait those few seconds to hit the authentication provider .. then return back. When I'm doing lots of testing, this all adds up.
I do lots of development on the train to/from work .. and I don't have any internet connection during that time.
I want to test various user scenarios -> eg. Name is too long. No last name. No Gender, etc.
Usage is by convention: when the word 'fake' is prepended to the authentication provider you wish to authenticate against, a FakeProvider (with the Name being the fake provider name) is created and used.
So you just hardcode your html link.
For example: We want to offer a normal Google Login button and a FakeGoogle login button.
<a href="/authentication/redirect/fakegoogle">Click here to Sign In with your Google account</a>
TODO: Grab a screenshot.
- Default data.
- Programatically configure data (server side)
- Programatically configure data (client side via route hacking).
You can define your own UserInformation data to returned.
TODO: Show code example wiring up hard coded User Information.
You can pretend an error has occurred with the provider, to handle testing that scenario. Eg. the user didn't agree to accept what is being shared.
TODO: show code example of wiring up hard coded exceptions.
- NancyFX Manual Setup
- NancyFX Automatic Setup
- MVC Manual Setup
- MVC Automatic Setup
- web.config
- global.asax
- bootstrapper