product icon

Office 365 Suite App Integration

    Set up an Office 365 app integration so that your users can sign into this app using the same credentials that they use for LastPass.

    Notice: Alternatively, LastPass MFA can be used for secure login to Office 365/Azure AD SSO while maintaining Azure AD as the primary Identity Provider. For more info, visit How do I configure my Azure AD account to use LastPass MFA for authentication?

    Part 1 - Add the SSO app to LastPass

    1. Log in and access the LastPass new Admin Console by doing either of the following:
      • While logged in to LastPass, click the active LastPass icon active LastPass icon in your web browser toolbar, then select Admin Console in the menu.
      • Log in at https://admin.lastpass.com with your admin email address and master password.
    2. Go to Applications > SSO apps.
    3. Select Add app in the upper-right navigation (or Search the catalog if you're adding your first app).
    4. Search for and select Office 365 Suite from the catalog.
    5. Click Continue, and you are taken to the Configure app section of the app configuration.
      Fastpath: LastPass automatically fills out all required information in the Set up app section for you. Some apps allow you to upload settings in an XML file, while others require you to copy and paste the following information:
      Name in LastPass Value
      Entity ID
      https://identity.lastpass.com
      SSO Endpoint
      https://identity.lastpass.com/SAML/SSOService
      Logout URL
      https://identity.lastpass.com/Login/Logout
      Certificate fingerprint Provided in the Set up app section of the SSO app.
      Certificate fingerprint (SHA256)
      Certificate (PEM)
    6. In the Set up app section, download the LastPass certificate in PEM format.
    7. For the next steps, open a new web browser window or tab. Go to the app's settings to enable single sign-on, and make sure your app recognizes LastPass as the Identity Provider.

    Part 2 - Configure the app in Office 365

    Before you begin: Be sure you have set up and verified a domain before proceeding with the steps below.
    Note: Adding a domain might require additional steps depending on your domain registration. Contact support if you require assistance.
    About this task: For detailed instructions, please see Microsoft Office 365 documentation.
    1. Log in to the Microsoft 365 admin center at https://admin.microsoft.com/Adminportal/Home.
    2. Select Settings > Domains in the left navigation.
    3. Confirm that you have a verified domain listed.
      CAUTION: DO NOT add any users at this stage.
      Verify domain ownership in Office365
    4. In the section where you are asked How do you want to use Office 365?, disable the checkboxes next to Exchange Online and Lync Online unless DNS entries are to be updated.
      CAUTION: Before proceeding, make sure that the domain you will use is not the default domain. Instead, configure the .onmicrosoft.com entry as the default domain.

    Part 3 - Finalize the Office 365 SSO app configuration in LastPass

    1. Copy the following integration script and save it as o365_integration.ps1:
      param (
          [string]$domain = $(throw "domain is required."),
          [string]$certFile = (Get-Location).path + "\LastPass_Certificate.txt"
      )
      
      $issuer = "https://identity.lastpass.com/"
      $ssoURL = "https://identity.lastpass.com/SAML/SSOService"
      $ecpURL = "https://identity.lastpass.com/SAML/ECP"
      $logoffURL = "https://identity.lastpass.com/Login/Logout"
      
      function IsValidDomain {
          param (
              [string]$domain
          )
      
          if ($domain -match "^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$") {
              return $true
          } else {
              return $false
          }
      }
      
      if (-Not (IsValidDomain $domain)) {
          Write-Host "$domain is not a valid domain."
          exit
      }
      
      if (-Not (Test-Path -Path $certFile -PathType Leaf)) {
          Write-Host "$certFile is not exists"
          exit
      }
      
      if (-Not (Get-Command "Connect-MsolService" -errorAction SilentlyContinue))
      {
          Write-Host "You need to install the MSOnline PowerShell module in order to continue."
          $install = Read-Host -Prompt "Would you like to install it now? [y/n]"
          if ($install -eq "y") {
              Install-Module MSOnline
          }else {
              Write-Host ("If you want to continue you need to install the MSOnline module. Please re-run the script..")
              exit
          }
          
      }
      
      if (Get-Command "Connect-MsolService" -errorAction SilentlyContinue){
      
          Connect-MsolService
          $certificate = [IO.File]::ReadAllText($certFile)
          $certificate = $certificate.Replace("-----BEGIN CERTIFICATE-----","")
          $certificate = $certificate.Replace("-----END CERTIFICATE-----","")
          $certificate = $certificate.Replace("`r","")
          $certificate = $certificate.Replace("`n","")
      
          Set-MsolDomainAuthentication -DomainName $domain -Authentication federated -PreferredAuthenticationProtocol SAMLP -IssuerUri $issuer -SigningCertificate $certificate -PassiveLogOnUri $ssoURL -ActiveLogOnUri $ecpURL -LogOffUri $logoffURL -Verbose
      }
    2. Copy the downloaded LastPass_Certificate.txt to the same folder.
    3. Open PowerShell with Administration Privileges.
    4. Navigate to the folder of your script with the cd <Saved Folder> command.
    5. Run the following script:
      o365_integration.ps1 -domain <your company domain>
    6. Check that the federation was successful with the Get-MsolDomain cmdlet.
    7. Return to the LastPass new Admin Console.
    8. Back on the Configure app page in the LastPass Admin Console (from Part 1), select Set up LastPass.
    9. In the ACS field, paste the following URL:
      https://login.microsoftonline.com/login.srf
    10. Optional: Enable Step-up authentication if you want to require users to confirm their identity using the LastPass Authenticator app upon each login to this SSO app.
      Remember: Passwordless login for SSO apps only supports authentication using stored biometrics (face or fingerprint) via push notification in the LastPass Authenticator app.
    11. Click Save & assign users > Users, groups & roles to begin making your selections.
    12. Search for and select your desired users, groups, and/or roles, then click Assign.
    13. Click Save & continue > Finish.
    14. Open PowerShell and execute the following command to add your user:
      New-MsolUser -UserPrincipalName -ImmutableId -FirstName -LastName -DisplayName -LicenseAssignment -usageLocation

      For more usage examples and templates, view Microsoft Online Powershell documentation.

    15. Log in to the Microsoft 365 admin center at https://admin.microsoft.com/Adminportal/Home.
    16. In your organization's page, select your newly created user.
    17. On the Licenses and apps tab, select Add license.
    18. Enable Assign license to <your user>.

    19. Enable your required license(s) and select Save changes.
    Results: Setup for your SSO app is complete! The LastPass users you assigned to this SSO app can now use their LastPass account to sign in to this SSO app going forward.