Skip to content

Commit

Permalink
Merge pull request #43 from OpenConext/feature/update-layout
Browse files Browse the repository at this point in the history
Update layout
  • Loading branch information
phavekes authored Sep 17, 2020
2 parents 2434cde + 164d6f4 commit 918bb78
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 48 deletions.
Binary file added public/images/header-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/surfconext-logo.png
Binary file not shown.
8 changes: 8 additions & 0 deletions public/scss/base/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ pre {
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

form label {
padding-right: 10px;
}

form input[type=text] {
width: 50%
}
8 changes: 6 additions & 2 deletions public/scss/components/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
max-width: $medium;
margin: 40px auto 0 auto;
margin-top: 0px;
padding: 15px 15px 40px 15px;
padding: 15px 15px 15px 15px;
position: relative;
transition: margin 150ms ease-in-out;

Expand Down Expand Up @@ -42,6 +42,10 @@
}
}

img {
width: 15%;
}

ul.links {
display: flex;
align-items: center;
Expand All @@ -64,7 +68,7 @@
}

&.title {
margin-left: 210px;
margin-left: 220px;
font-weight: bold;
text-transform: uppercase;
font-size: 22px;
Expand Down
4 changes: 2 additions & 2 deletions public/scss/components/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.navigation {
max-width: $medium;
margin: 0 auto;
padding: 25px 15px 0 15px;
padding: 10px 15px 0 15px;
font-size: 20px;
display: flex;

Expand All @@ -23,4 +23,4 @@
}

}
}
}
9 changes: 7 additions & 2 deletions src/Surfnet/AzureMfa/Infrastructure/Form/EmailAddressType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ final class EmailAddressType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('emailAddress', TextType::class, ['attr' => ['type' => 'email'], 'required' => true])
->add('submit', SubmitType::class)
->add('emailAddress', TextType::class, [
'label' => 'page.registration.form.email.label',
'attr' => ['type' => 'email'], 'required' => true
])
->add('submit', SubmitType::class, [
'label' => 'page.registration.form.email.submit',
])
;
}

Expand Down
14 changes: 6 additions & 8 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
<body>
<div class="header-container">
<div class="header">
<a class="logo" href="{{ url('homepage') }}">
<img src="{{ asset('images/surfconext-logo.png') }}" alt="SURFconext"/>
</a>
<img src="{{ asset('images/header-logo.png') }}" />
<ul class="links">
<li class="title">
<span>{{ 'page.title'|trans }}</span>
Expand All @@ -51,12 +49,12 @@
</div>
<div class="navigation-container">
<div class="navigation">
{% for route in ['homepage', 'gssp_saml_metadata'] %}
{% set translatekey = "page.navigation.route." ~ route %}
<a href="{{ path(route) }}" {% if current_route == route %} class='active'{% endif %}>{{ translatekey|trans }}</a>
{% endfor %}
{% if app.environment == 'dev' %}
<a href="{{ path('sp_demo') }}" {% if current_route == 'sp_demo' %} class='active'{% endif %}>{{ 'page.navigation.route.sp_demo'|trans }}</a>
{% for route in ['homepage', 'gssp_saml_metadata'] %}
{% set translatekey = "page.navigation.route." ~ route %}
<a href="{{ path(route) }}" {% if current_route == route %} class='active'{% endif %}>{{ translatekey|trans }}</a>
{% endfor %}
<a href="{{ path('sp_demo') }}" {% if current_route == 'sp_demo' %} class='active'{% endif %}>{{ 'page.navigation.route.sp_demo'|trans }}</a>
{% endif %}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/Features/azure-da_authentication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Feature: When using AzureAD directly
Scenario: When a user is authenticating a token
Given I send an authentication request to "https://azure-mfa.stepup.example.com/saml/sso" without NameID
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-b.example.com |
Expand All @@ -15,8 +15,8 @@ Feature: When using AzureAD directly
Scenario: Should fail when a authnmethodsreferences attribute is not released
Given I send an authentication request to "https://azure-mfa.stepup.example.com/saml/sso" without NameID
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-b.example.com |
Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/Features/azure-da_registration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Feature: When using AzureAD directly
Scenario: When a user is registering a new token
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-b.example.com |
Expand All @@ -15,8 +15,8 @@ Feature: When using AzureAD directly
Scenario: Should fail when a authnmethodsreferences attribute is not released
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-b.example.com |
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Features/locale.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Feature: When an user needs switch it's preferred locale
Then I should see "Registratie"
And I follow "EN"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-a.example.com |
Then I should be on "https://azure-mfa.stepup.example.com/saml/sso_return"
And the SAML Response should contain element "StatusCode" with attribute "Value" with attribute value "urn:oasis:names:tc:SAML:2.0:status:Success"
And the SAML Response should contain element "NameID" with value containing "[email protected]"
And the SAML Response should contain element "NameID" with value containing "[email protected]"
26 changes: 13 additions & 13 deletions tests/Functional/Features/registration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Feature: When an user needs to register for a new token
Scenario: When a user is registering a new token
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | test-user@institution-a.example.com |
Expand All @@ -18,8 +18,8 @@ Feature: When an user needs to register for a new token
Scenario: When a user is registering a new token, and if an unknown mail address gets released authentication at Azure MFA fails
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
| urn:mace:dir:attribute-def:mail | unknown@institution-a.example.com |
Expand All @@ -29,8 +29,8 @@ Feature: When an user needs to register for a new token
Scenario: When a user is registering a new token, and if no mail attribute gets released authentication at Azure MFA fails
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA succeeds and the following attributes are released:
| name | value |
Then I should be on "https://azure-mfa.stepup.example.com/saml/sso_return"
Expand All @@ -39,17 +39,17 @@ Feature: When an user needs to register for a new token
Scenario: When a user is registering a new token, authentication at Azure MFA fails
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress with "test-user@institution-a.example.com"
When I press "email_address_submit"
And the login with Azure MFA gets cancelled
Then I should be on "https://azure-mfa.stepup.example.com/saml/sso_return"
And the SAML Response should contain element "StatusCode" with attribute "Value" with attribute value "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"

Scenario: When a user is registering a new token, authentication at Azure MFA fails
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
Given the login with Azure MFA fails
Then I should be on "https://azure-mfa.stepup.example.com/saml/sso_return"
And the SAML Response should contain element "StatusCode" with attribute "Value" with attribute value "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"
Expand All @@ -58,9 +58,9 @@ Feature: When an user needs to register for a new token
Given I send a registration request to "https://azure-mfa.stepup.example.com/saml/sso"
# Fill an email address that does not match any of the configured email domains
Then I should see "Registration"
And I fill in "Email address" with "[email protected]"
When I press "Submit"
When I press "Submit"
And I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"
When I press "email_address_submit"
Then I should be on "https://azure-mfa.stepup.example.com/registration"
And I should see "The provided email address did not match any of our configured email domains."

Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/Features/sp_registration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Feature: When an user needs to register for a new token
And I should see "Registration"

# GSSP assigns a subject name id to the user
Given I fill in "Email address" with "[email protected]"
When I press "Submit"
Given I fill in "email_address_emailAddress" with "[email protected]"
When I press "email_address_submit"

# The MFA SSO page
Then I should be on "https://azure-mfa.stepup.example.com/mock/sso"
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/WebTests/DefaultControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public function testIndex()
$crawler = $client->request('GET', '/');

$this->assertEquals(200, $client->getInternalResponse()->getStatusCode());
$this->assertStringContainsString('Welcome to the Azure MFA GSSP', $crawler->filter('h2')->text());
$this->assertStringContainsString('Welcome to the Azure MFA', $crawler->filter('h2')->text());
}
}
8 changes: 5 additions & 3 deletions translations/messages.en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
service_provider: Service provider

page.title: Azure MFA GSSP
page.title: Azure MFA

page.header.stepup-gateway-gssp: Wiki

Expand All @@ -12,8 +12,8 @@ page.navigation.route.sp_demo: Demo SP

page.footer.terms: Terms and Conditions

page.index.title: Welcome to the Azure MFA GSSP
page.index.body.intro: TODO Introduction
page.index.title: Welcome to the Azure MFA plugin
page.index.body.intro: This is the landingpage for the Azure MFA plugin in OpenConext-Stepup.

page.index.external_sp: External service provider
page.index.internal_sp: Internal service provider
Expand Down Expand Up @@ -78,6 +78,8 @@ page.registration.register_user: Register user
page.registration.error_response: Error response
page.registration.random_default_error: random registration error
page.registration.submit_error: Return authentication failed
page.registration.form.email.label: Email address
page.registration.form.email.submit: Next

page.authentication.title: Athenticate the user
page.authentication.sub_title: Authentication
Expand Down
10 changes: 6 additions & 4 deletions translations/messages.nl.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
service_provider: Service provider

page.title: Azure MFA GSSP
page.title: Azure MFA

page.header.stepup-gateway-gssp: Wiki

Expand All @@ -12,8 +12,8 @@ page.navigation.route.sp_demo: Demo SP

page.footer.terms: Terms and Conditions

page.index.title: Welcome to the Azure MFA GSSP
page.index.body.intro: TODO Introduction
page.index.title: Welkom bij de Azure MFA plugin
page.index.body.intro: Dit is de langsingpagina voor de Azure MFA plugin in Openconext-Stepup

page.index.external_sp: External service provider
page.index.internal_sp: Internal service provider
Expand Down Expand Up @@ -69,6 +69,8 @@ page.registration.register_user: Gebruiker registreren
page.registration.error_response: Foutreactie
page.registration.random_default_error: willekeurige registratiefout
page.registration.submit_error: Zend een registratie mislukt response
page.registration.form.email.label: E-mailadres
page.registration.form.email.submit: Volgende

page.authentication.title: Authenticeer (verifieer) de gebruiker
page.authentication.sub_title: Verifiëren
Expand Down Expand Up @@ -104,4 +106,4 @@ page.sp.common_properties.title: Algemeene request parameters
en: EN
nl: NL
nl_NL: NL
en_EN: NL
en_EN: EN

0 comments on commit 918bb78

Please sign in to comment.