Fake Open ID for testing

Like SO, I will depend on many Open ID providers to provide user authentication, and I will use my own authorization methods. but I'm still under development and do not want to work with real OpenID providers at the moment, what approach can I use to test my users and their actions on the website (without TDD), to imitate real users, but do not really use providers Open ID

There is no need to automatically transfer users to real OpenID servers (when switching to production mode), as current users are intended only for testing and Unit-test code.

I assume that I need a User Service layer that provides an extremely abstract way to communicate with users, so the transition to real Open ID providers can be smooth in the future and does not affect the logic of my code already written.

Using C # .Net 4, ASP.Net MVC 3, Ninject

+6
source share
3 answers

DotNetOpenAuth provides both server and client parts of OpenID and can be used to run your own OpenID provider for local testing.

  • Provide your sites with your OpenID-enabled provider included in this library.

  • An example of websites dedicated to third-party sites and providers shows you how to do this.

+6
source

I simply register my test id as a user with various organizations. I see nothing wrong with that. I see various answers and their differences.

It was terribly easy for me to code for the openid user. You just need to understand the sequence of answers. Draw a UML sequence diagram to help you understand before you begin coding. No need to fake openId. Otherwise, hack the openid server yourself.

+3
source

Your services should not depend on OpenID. Just connect OpenID to the authentication module to provide a local user-friendly approach. During development, you can force the auth module to return a fake user with the necessary permissions.

In the beta environment, you can enable OpenID and use test accounts from any OpenID provider. The need to enter the system at the development stage will simply slow down the work of all developers. Any authentication error or interruptions in the Internet will kill everyone.

+1
source

Source: https://habr.com/ru/post/891850/