2017-10-09 05:28:46 +07:00
|
|
|
Feature: Authentication scenarii
|
2017-07-27 04:45:26 +07:00
|
|
|
|
|
|
|
Scenario: User succeeds first factor
|
2017-11-03 03:34:07 +07:00
|
|
|
Given I visit "https://login.example.com:8080/"
|
2017-07-27 04:45:26 +07:00
|
|
|
When I set field "username" to "bob"
|
|
|
|
And I set field "password" to "password"
|
|
|
|
And I click on "Sign in"
|
2017-11-03 03:34:07 +07:00
|
|
|
Then I'm redirected to "https://login.example.com:8080/secondfactor"
|
2017-07-27 04:45:26 +07:00
|
|
|
|
|
|
|
Scenario: User fails first factor
|
2017-11-03 03:34:07 +07:00
|
|
|
Given I visit "https://login.example.com:8080/"
|
2017-07-27 04:45:26 +07:00
|
|
|
When I set field "username" to "john"
|
|
|
|
And I set field "password" to "bad-password"
|
|
|
|
And I click on "Sign in"
|
2017-10-11 04:03:30 +07:00
|
|
|
Then I get a notification of type "error" with message "Authentication failed. Please check your credentials."
|
2017-07-27 04:45:26 +07:00
|
|
|
|
2017-09-22 03:07:34 +07:00
|
|
|
Scenario: User registers TOTP secret and succeeds authentication
|
2017-11-03 03:34:07 +07:00
|
|
|
Given I visit "https://login.example.com:8080/"
|
2017-07-27 04:45:26 +07:00
|
|
|
And I login with user "john" and password "password"
|
|
|
|
And I register a TOTP secret called "Sec0"
|
2017-11-03 03:34:07 +07:00
|
|
|
When I visit "https://admin.example.com:8080/secret.html"
|
2018-04-25 04:03:05 +07:00
|
|
|
And I'm redirected to "https://login.example.com:8080/?rd=https%3A%2F%2Fadmin.example.com%3A8080%2Fsecret.html"
|
2017-07-27 04:45:26 +07:00
|
|
|
And I login with user "john" and password "password"
|
|
|
|
And I use "Sec0" as TOTP token handle
|
2017-10-22 06:23:26 +07:00
|
|
|
And I click on "Sign in"
|
2017-11-03 03:34:07 +07:00
|
|
|
Then I'm redirected to "https://admin.example.com:8080/secret.html"
|
2017-07-27 04:45:26 +07:00
|
|
|
|
|
|
|
Scenario: User fails TOTP second factor
|
2017-11-03 03:34:07 +07:00
|
|
|
When I visit "https://admin.example.com:8080/secret.html"
|
2018-04-25 04:03:05 +07:00
|
|
|
And I'm redirected to "https://login.example.com:8080/?rd=https%3A%2F%2Fadmin.example.com%3A8080%2Fsecret.html"
|
2017-09-03 06:25:43 +07:00
|
|
|
And I login with user "john" and password "password"
|
2017-07-27 04:45:26 +07:00
|
|
|
And I use "BADTOKEN" as TOTP token
|
2017-10-22 06:23:26 +07:00
|
|
|
And I click on "Sign in"
|
2017-10-11 04:03:30 +07:00
|
|
|
Then I get a notification of type "error" with message "Authentication failed. Have you already registered your secret?"
|
2017-07-27 04:45:26 +07:00
|
|
|
|
2017-09-22 03:07:34 +07:00
|
|
|
Scenario: Logout redirects user to redirect URL given in parameter
|
2018-04-25 04:03:05 +07:00
|
|
|
When I visit "https://login.example.com:8080/logout?rd=https://home.example.com:8080/"
|
2017-11-03 03:34:07 +07:00
|
|
|
Then I'm redirected to "https://home.example.com:8080/"
|