Skip to content
Snippets Groups Projects
Commit 44322004 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Topic/1224-overhaul' into 'Product/797-overhaul'

Build: Remove Deploy Script from STS repo

See merge request !71
parents 7a865d19 82d97e82
No related tags found
2 merge requests!72Product/797 overhaul,!71Build: Remove Deploy Script from STS repo
$name = 'Coscine STS'
$certAuthorityName = 'Coscine STS certificate'
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Remove-SPTrustedIdentityTokenIssuer $name
Remove-SPTrustedRootAuthority $certAuthorityName
# For production, use the coscine.rwth-aachen.de pfx
$pfxFilePath = $( Read-Host "Input the file path to the pfx file please" )
consul kv put 'coscine/global/sts/pfx' @$pfxFilePath
$pfxpassword = $( consul kv get 'coscine/global/sts/pfxpassword' )
if(!$pfxpassword) {
$pfxpassword = $( Read-Host "Input the pfx file passwod please" )
consul kv put 'coscine/global/sts/pfxpassword' $pfxpassword
}
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($pfxFilePath, $pfxpassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
$certBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert)
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($certBytes)
New-SPTrustedRootAuthority -Name $certAuthorityName -Certificate $cert
# TODO work on Claim Mapping
# Also figure out why the search is not working
$map0 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' -IncomingClaimTypeDisplayName 'DisplayName' -LocalClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/displayname'
$map1 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider' -IncomingClaimTypeDisplayName 'IdentityProvider' -SameAsIncoming
$map2 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress' -IncomingClaimTypeDisplayName 'Email' -SameAsIncoming
$map3 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' -IncomingClaimTypeDisplayName 'Surname' -SameAsIncoming
$map4 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' -IncomingClaimTypeDisplayName 'GivenName' -SameAsIncoming
$map5 = New-SPClaimTypeMapping -IncomingClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' -IncomingClaimTypeDisplayName 'NameIdentifier' -LocalClaimType 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid'
#$realm = 'http://claims.sp2013.local/_trust/default.aspx'
#$signinurl = 'https://sp2013-reference.accesscontrol.windows.net:443/v2/wsfederation'
# SharePoint URL
# Example: $sharePointUrl = 'http://d-sp11.devlef.campus.rwth-aachen.de'
$sharePointUrl = $( Read-Host 'Input the SharePoint Url' )
if ($sharePointUrl -notmatch '/$')
{
$sharePointUrl += '/'
}
$realm = $sharePointUrl + '_trust/default.aspx'
# STS Url
# Example: $signinurl = 'https://d-sp11.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.STS/'
$signinurl = $( Read-Host 'Input the STS Url' )
$ip = New-SPTrustedIdentityTokenIssuer -Name $name -Description 'Coscine STS' -Realm $realm -ImportTrustCertificate $cert -ClaimsMappings $map0,$map1,$map2,$map3,$map4,$map5 -SignInUrl $signinurl -IdentifierClaim $map5.InputClaimType
$ip.UseWReplyParameter=$true
$ip.Update()
$winAp = new-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
Set-SPWebApplication -Identity $sharePointUrl -AuthenticationProvider $ip,$winAp -Zone "Default"
$ip
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment