If you need a more advanced configuration when you set up Single Sign On (SSO) for Microsoft 365 in JumpCloud, you can use the command provided in this KB with the MSOnline module.
Make sure modern authentication is enabled for the Microsoft 365 Tenant. Learn more in Enable Modern Authentication for Microsoft 365.
Running the command
- Start Powershell on a system with the Azure Active Directory Module for Windows PowerShell installed.
- Define variables. This will prompt for log in, the username accepts UPN format, such as [email protected].
- Run:
$cred=Get-Credential
- Connect with the saved credentials:
Connect-MsolService –Credential $cred
- Define your Microsoft 365 Domain:
$domain=”yourdomain.tld”
- Define the idpUrl, this is the same value as the IDP URL in the connector, default value shown:
$idpUrl=”https://sso.jumpcloud.com/saml2/office365″
- Define a logout URL:
$logoutUrl=”https://console.jumpcloud.com/userconsole/”
- Define the public cert.
This variable can't contain -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- and can't contain spaces or newlines.
Export the metadata file from your JumpCloud SSO configuration and copy the certificate string between
<ds:X509Certificate> and </ds:X509Certificate>
$certificate="MIIDtTCCAp2gAwIBAgIJAJUpvv+YllN1MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAlVTMRMwEQY...
TRUNCATED...
wcsC1lArmug//RG+BPp6yT6qhsm4g4wVcxpHWT8cA1py0TQaIQbNnBqNLDbQJl9oJ3PB9eiKEpEWtdtmcQOW3yB1AdxsQBKxtaNT5PypyLqnJ+e8="
- Define the Issuer URI, this must be the same value as the IDP Entity ID previously defined:
$issuerUri=”yourdomain.com”
- Run the following to enable SSO for the defined domain:
Set-MsolDomainAuthentication –DomainName $domain -FederationBrandName $domain -Authentication Federated -IssuerUri $issuerUri -LogOffUri $logoutUrl -PassiveLogOnUri $idpUrl -ActiveLogOnUri $idpUrl -SigningCertificate $certificate -PreferredAuthenticationProtocol SAMLP
Now that you’ve configured the service provider, read SSO with M365 to learn how to authorize user access and validate authentication workflows.