Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

# Haetaan käyttäjän rooli AD:n employeeType attribuutista ja lisätään (add) se käyttäjän attribuutteihin
Add Employee Type as Role
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
 => add(store = "Active Directory", types = ("http://schemas.microsoft.com/ws/2008/06/identity/claims/role"), query = ";employeeType;{0}", param = c.Value);
 
# Tutkitaan roolin arvo ja lähetetään eteenpäin (issue) arvoa vastaava tekstimuotoinen rooli
Send mpassUserRole oppilas
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Value =~ "^1" ]
 => issue(Type = "mpassUserRole", Value = "oppilas"); 
 
Send mpassUserRole opettaja
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Value =~ "^2" ]
 => issue(Type = "mpassUserRole", Value = "opettaja");

Windows Server 2019 ADFS

Windows Server 2019 ADFS lisää oletuksena metadataansa contact personin email addressin tyhjänä elementtinä. Jotta metadatan validointi toimii, niin email address tulee olla määriteltynä.


Code Block
languagepowershell
# Tarkista ensin onko contact person:n tiedot jo annettu:
(Get-AdfsProperties).ContactPerson

# Jos edellisen komennon tuloksena EmailAddresses on tyhjä, niin tällä voit lisätä sen. Huom! tämä ylikirjoittaa mahdolliset aiemmat ContactPerson määritykset, joten kaikki tiedot tulee asettaa uudelleen.
$CP = New-AdfsContactPerson [-Company <string>] [-EmailAddress <string[]>] [-GivenName <string>] [-TelephoneNumber <string[]>] [-Surname <string>]
Set-AdfsProperties -ContactPerson $CP