The user consent flow is implemented by default for Office 365 organizations, but an administrator can change this default to prevent end-users from installing applications.

If the user consent is turned off, problems like this can occur when trying to connect to cloudHQ:
 
Office365 Error

How to turn on user consent in Office365:

  1. Get the Windows Azure AD PowerShell Module.
  2. Connect to your Office 365 Tenant.
  3. $msolcred = get-credential
    connect-msolservice -credential $msolcred

  4. Check the current settings for allowing user consent.
  5. Get-MsolCompanyInformation | fl DisplayName,UsersPermissionToUserConsentToAppEnabled

    DisplayName : Contoso
    UsersPermissionToUserConsentToAppEnabled : False

    Note: A value of “False” indicates that users cannot consent to applications.

  6. Turn on user consent to applications.
  7. Set-MsolCompanySettings –UsersPermissionToUserConsentToAppEnabled:$true

  8. Verify that user consent to applications is turned on.

Get-MsolCompanyInformation | fl DisplayName,UsersPermissionToUserConsentToAppEnabled

DisplayName : Contoso
UsersPermissionToUserConsentToAppEnabled : True

Note: A value of “True” indicates that users can consent to applications.

Important: Turning on user consent impacts users in the following ways:

  • End users can consent to applications. This means that installed or native applications can be installed in the Office 365 organization. It is possible for an administrator to install a native application and make it available to all users.
  • Existing consents that users provided remain valid until the user either revokes the consent (for web applications) or uninstalls the application (for native applications).