Using the LoginInterceptor, Membrane API Gateway can log requests and responses.
In this example we will visit a website and take a look at the logs in the console.
To run the example execute the following steps:
-
Go to the
examples/security/logindirectory. -
Execute
membrane.cmd -
Open the URL http://localhost:2000/ in your browser.
-
Enter
johnas username andpasswordas password. -
Install the "Google Authenticator" app on your Android phone. Launch the app.
-
Select "Set up account" from the menu. Choose "Enter provided key".
-
Enter
test@localas name andabcdefghijklmnopas key (the same key specified for John in the examples/login/proxies.xml). Select "Time based" authentication and click "Add". -
Enter the numeric token shown by the app into the web form and click "Verify". Be quick, as the token frequently changes as indicated by the animation within the app.
-
You are now "logged in" and Membrane forwards your requests to the server specified in
examples/login/proxies.xml. -
Open http://localhost:2000/login/logout in your browser.
-
You are logged out again.
See
- login reference