Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
STS
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
apis
STS
Merge requests
!72
Product/797 overhaul
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Product/797 overhaul
Product/797-overhaul
into
master
Overview
0
Commits
2
Pipelines
1
Changes
1
Merged
Marcel Nellesen
requested to merge
Product/797-overhaul
into
master
4 years ago
Overview
0
Commits
2
Pipelines
1
Changes
1
coscine/issues#797
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
44322004
2 commits,
4 years ago
1 file
+
0
−
65
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/deploySTS.ps1 deleted
100644 → 0
+
0
−
65
View file @ 7a865d19
$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
Loading