Skip to content

Commit

Permalink
date and regex match
Browse files Browse the repository at this point in the history
  • Loading branch information
jworkmanjc committed May 16, 2024
1 parent da0538d commit b0cc1a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud
#
# Generated on: 5/14/24
# Generated on: 5/16/24
#

@{
Expand Down Expand Up @@ -78,3 +78,5 @@





Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ function Get-MetadataFromXML {
# domain should be extracted from entityID
$domainMatches = $XMLInfo.EntityDescriptor.entityID | Select-String -Pattern '(https:\/\/|urn:uri:)(=?.*)'
if ($domainMatches) {
if (($domainMatches.Matches.Groups[0].Value -match "https://") -or ($domainMatches.Matches.Groups[0].Value -match "urn:rui:")) {
if (($domainMatches.Matches.Groups[0].Value -match "https://") -or ($domainMatches.Matches.Groups[0].Value -match "urn:uri:")) {
# entity ID should match https: or urn:uri:
$entityID = $domainMatches.Matches.Groups[0].Value
} else {
throw "The supplied EntityID: $($XMLInfo.EntityDescriptor.entityID) does not appear to be correct. The domain name may be missing 'https://' or 'urn:uri:' as a prefix to the domain name. EX: within the JumpCloud SSO application for O365, supply an EntityID value such as 'https://myDomain.com' or 'urn:uri:myDomain.com'"
}
# domain should be the second group match from the $domainMatches variable
$domain = $domainMatches.Matches.Groups[2].Value
Expand Down

0 comments on commit b0cc1a4

Please sign in to comment.