e-legitimation (till exempel mobilt BankId)
1.
Installation SIMPLESAML
För installation av SimpleSAML och Apache httpd följ guiden
för SkolFederationen.
https://fedwiki.atlassian.net/wiki/spaces/SKOL/pages/1605859/1.+SimpleSAMLphp+installation
2.
Konfiguration
eHälsomyndigheten har valt att använda en statisk
username/password validering för att skapa olika typer av SAML-intyg.
2.1
Konfiguration en Identity Provider
För guiden för skolfederationen: https://fedwiki.atlassian.net/wiki/spaces/SKOL/pages/2326540/1.1.+SimpleSAMLphp+IdP
Gör därefter följande anpassningar:
2.1.1
Saml20-idp-hosted
För att modifiera den hostade IdP:n lägg till följande
uppgifter i Er Idp. Editera fil metadata/saml20-idp-hosted.php
$metadata['__DYNAMIC:1__']
= array(
'host' => '__DEFAULT__',
'auth' => 'example-userpass',
'assertion.lifetime'
=> 3500,
'privatekey' => 'bankid.key',
'certificate' => ‘bankid.crt',
'attributes.NameFormat' => 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri',
'authproc' => array(
97 => array(
'class' =>
'saml:AuthnContextClassRef',
'AuthnContextClassRef'
=> 'urn:oasis:names:tc:SAML:2.0:ac:classes:SoftwarePKI',
),
100 => array(
'class' =>
'core:AttributeMap',
'name2oid'
),
),
'NameIDFormat' =>
'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
);
|
'assertion.lifetime' sätter giltighetstiden på saml-intyget.
2.1.2 Saml20-idp-remote
För att modifiera remote IdP:n lägg till följande
uppgifter i Er Idp. Editera fil metadata/saml20-idp-remote.php. Om filen inte
finns skapa den genom att gå till https://localhost/simplesaml/saml2/idp/metadata.php?output=xhtml
/Bild%201%20e-leg.png)
Figur 1 Saml20-idp-remote innehåll
Klistra in innehållet som i figuren ovan. OBS! Figuren är ett
exempel.
2.2 Konfiguration av Service provider
2.2.1
Saml20-sp-remote
För att modifiera den remote IdP:n lägg till följande
uppgifter i Er Idp. Editera fil metadata/saml20-sp-remote.php. Om filen inte
finns skapa den genom att gå på https://localhost/simplesaml/module.php/saml/sp/metadata.php/default-sp?output=xhtml
/Bild%202%20e-leg.png)
Figur 2 Saml20-sp-remote innehåll
Klistra in innehållet som i figuren ovan. OBS! Figuren är ett
exempel.
2.3 Konfiguration av Authsources
Demon har valt att använda sig av user/password exempel som
kommer med vid installation av SimpleSAML.
Filen /var/simplesamlphp/config/authsources.php
innehåller exempel på användare som eHälsomyndigheten lagt till som kommer att
användas som roller.
De tillagda attributen är det som sedan kommer med en
SAMLResponse.
<?php
$config = array(
// This is a authentication
source which handles admin authentication.
'admin' => array(
// The default is to use
core:AdminPassword, but it can be replaced with
// any authentication
source.
'core:AdminPassword',
),
// An authentication source
which can authenticate against both SAML 2.0
// and Shibboleth 1.3 IdPs.
'default-sp' => array(
'saml:SP',
// The entity ID of this
SP.
// Can be NULL/unset, in
which case an entity ID is generated based on the metadata URL.
'entityID' =>
'http://www.ehalsomyndigheten.se',
// The entity ID of the IdP
this should SP should contact.
// Can be NULL/unset, in
which case the user will be shown a list of available IdPs.
'idp' => NULL,
// The URL to the discovery
service.
// Can be NULL/unset, in
which case a builtin discovery service will be used.
'discoURL' => null,
'certificate' => bankid.cer',
'privatekey' => bankid.key',
'signature.algorithm' =>
'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
),
'example-userpass' => array(
'exampleauth:UserPass',
'PRIVATPERSON:bankid' =>
array(
'Subject_SerialNumber'
=> array('199307122383')
),
),
);
|
Det publika certifikatet skickas till eHälsomyndigheten,
eHälsomyndigheten lagrar certifikatet i sin lista över giltiga BankId.
Kör kommando för att starta igång tjänsten.