Office 365 For WHMCS
Line 131: | Line 131: | ||
=Installation= | =Installation= | ||
− | <h4 style="color: #ff0000; font-weight:bold; text-align:center;">Please be informed that Office 365 For WHMCS 2. | + | <h4 style="color: #ff0000; font-weight:bold; text-align:center;">Please be informed that Office 365 For WHMCS 2.X is not compatible with its 1.0 version due to the changes introduced to the creation process of subscriptions and users.<br/> |
If the mechanism available in the 1.0 version suits your requirements, do not update your module to the latest version.</h4> | If the mechanism available in the 1.0 version suits your requirements, do not update your module to the latest version.</h4> | ||
Line 140: | Line 140: | ||
'' '''Important:''' This module configuration requires a [https://partner.microsoft.com/ Microsoft Partner Network] account with CSP '''Direct (Tier 1)''' Model.''<br/><br/> | '' '''Important:''' This module configuration requires a [https://partner.microsoft.com/ Microsoft Partner Network] account with CSP '''Direct (Tier 1)''' Model.''<br/><br/> | ||
− | '' '''Note:''' If you | + | '' '''Note:''' If you still use Office 365 For WHMCS version '''1.0.0''', [https://www.docs.modulesgarden.com/Office_365_1.0.0_For_WHMCS read about it here].'' |
|} | |} | ||
{| | {| | ||
Line 182: | Line 182: | ||
{| | {| | ||
|style="padding: 0px 0px 30px 25px;"|[[File:O2_5.png]] | |style="padding: 0px 0px 30px 25px;"|[[File:O2_5.png]] | ||
+ | |} | ||
+ | |||
+ | ==Obtaining API Details== | ||
+ | {| | ||
+ | |style="padding: 10px 0px 30px 15px;"|Before you start to [[#Configuration_of_Server|configure the server]], you need to obtain some neccessary data to connect to API.<br/> | ||
+ | The data you need: | ||
+ | * '''APP ID''' | ||
+ | * '''APP Secret''' | ||
+ | * '''Common Name / Tenant ID''' | ||
+ | * '''Key Vault APP ID''' | ||
+ | * '''Key Vault Secret ID''' | ||
+ | * '''Key Vault Directory ID''' | ||
+ | * '''Key Vault Domain''' | ||
+ | In the next steps, we will guide you through the process of getting the data. | ||
+ | |||
+ | '' '''Note:''' All of the following data is only an example, so please be aware that some discrepancies can appear on the screens below.<br/> The process of obtaining the data needs to be carried out on your Microfost account (or accounts) on your own.<br/> Please keep in mind that since the date of this publication, some changes to the interface or the process of getting the neccessary data from Microsoft may have occured. <br/> Therefore, the steps and screens presented below may not always be accurate and refect the actual starte of affairs.<br/> If any inaccuracies are found, try to adjust to them as much as possible, or contact our [https://www.modulesgarden.com/support support] for assistance.'' | ||
+ | |||
+ | |} | ||
+ | |||
+ | ===Creating Application in Microsoft Azure=== | ||
+ | {| | ||
+ | |style="padding: 10px 0px 15px 15px;"|The first step is to create an application in your Azure Active Directory if you do not have it yet.<br/> | ||
+ | Log in to your panel in [https://portal.azure.com/ Microsoft Azure.]<br/> | ||
+ | Then, expand the left sidebar and select '' 'Azure Active Directory' '' from the menu. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_1.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|On the newly opened page, choose '' 'App registrations' '' from the left menu, and then click on '' 'New registration' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_2.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 15px 15px;"|Enter an application name on the newly opened page. Leave the selected by default 'Supported account types' unchanged .<br/> | ||
+ | Later, you need to provide the web '' 'Redirect URI' ''. This address must directly lead to the '' 'auth.php' '' file located in the folder with the module on your WHMCS server. For example:<br/> | ||
+ | https://my-whmcs.com/modules/servers/office365/auth.php | ||
+ | Please make sure that it is correct and reachable from outside - your WHMCS server must accept SSL connections. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_3.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 15px 15px;"|After clicking on the '' 'Register' '' button, you will be redirected to the page that generated your application data. | ||
+ | <div id="app1_details"></div> | ||
+ | There you will find: | ||
+ | * '''Application (client) ID''' | ||
+ | * '''Directory (tenant) ID''' | ||
+ | '''Write it down''', as you will need it afterwards to configure the server in WHMCS. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_4.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Next, go to the '' 'Certificates & secrets' '' tab from the side menu and click on '' 'New client secret' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_5.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Before adding, provide it with a description and set 'never' in the 'Expire' option. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_6.png]] | ||
+ | |} | ||
+ | {| | ||
+ | <div id="app1_secret"></div> | ||
+ | |style="padding: 0px 0px 15px 15px;"|A new '''Client Secret''' will be created. Copy it to a safe place, as you will need it later for the server configuration in WHMCS.<br/> | ||
+ | '' '''Important:''' Copy the new client secret value '''now'''. You '''will not''' be able to retrieve it after you perform another operation or leave this blade!'' | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_7.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Now, you need to set appropriate permissions. To do so, move to the '' 'API permissions' '' tab and click on '' 'Add a permission' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_8.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Choose '' 'APIs my organization uses' '' and then '' 'Microsoft Partner Center' '' from the list. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_9.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Tick the '' 'user_impersonation' '' permission and click on '' 'Add permissions' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_10.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|After adding permissions, click again on '' 'Add a permission' '' and then, from the '' 'Microsoft APIs' '' tab, choose '' 'Microsoft Graph' '' | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_11.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Select the '' 'Delegated pemissions' ''type as well as find and tick '' 'offline_access' '' on the list. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_12.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Moreover, on the same list, find and mark '' 'User.Read' '' and finally click on '' 'Add permissions' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_13.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 15px 15px;"|Lastly, the scheme of allocated permissions should look as presented below.<br/> If it is correct, click on '' 'Grant admin consent for <your company name>' '' and confirm this action. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_14.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 30px 25px;"|[[File:O2_API_15.png]] | ||
+ | |} | ||
+ | |||
+ | ===Creating Key Vault=== | ||
+ | {| | ||
+ | |style="padding: 10px 0px 15px 15px;"|The final step in getting the data needed to connect to API is to generate Key Vault.<br/> | ||
+ | Azure Key Vault is a cloud service used to manage keys, secrets, and certificates.<br/> | ||
+ | It is required, so that the application and Office 365 For WHMCS that uses it, can operate properly.<br/> | ||
+ | |||
+ | To create Key Vault, you will need the application again, but this time with other permissions. | ||
+ | |||
+ | '' '''Note:''' Key Vault can be generated in another Microsoft account, including live environment, if it turns out that you do not have access to it for some reasons, for example from your test environment.'' | ||
+ | |||
+ | <div id="app2_details"></div> | ||
+ | <div id="app2_secret"></div> | ||
+ | At the beginning, follow the same steps as when setting up the application in Microsoft Azure. That is: | ||
+ | # Go to '' 'App registrations' '' and create a new application using the '' 'New registration' '' button | ||
+ | # Provide it with a name, for example '' 'Application For Key Vault' '' and as previously, enter '' 'Redirect URI' '' which leads to the '' 'auth.php' '' file in your WHMCS | ||
+ | # After generating the application, copy its ''' '' 'Application (client) ID' '' ''' as well as ''' '' 'Directory (tenant) ID' '' ''' | ||
+ | # Then, in the '' 'Certificates & secrets' '' section, create ''' '' 'New client secret' '' ''' and '''do not forget''' to copy it after creating | ||
+ | # Move to the '' 'Api permissions' '' section | ||
+ | |||
+ | Here, the differences appear, because Application For Key Vault demands different permissions. This is: | ||
+ | |||
+ | * '''user_impersonation''' for '''Azure Key Vault''' | ||
+ | <!--* '''user_impersonation''' for '''ConnectionsService'''--> | ||
+ | |||
+ | As before, let's add permissions. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_16.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Select '' 'Azure Key Vault' '' from '' 'Microsoft APIs' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_17.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Next, tick '' 'user_impersonation' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_18.png]] | ||
+ | |} | ||
+ | <!-- | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Repeat the last step, find '' 'ConnectionsService' '' APIs my organization uses''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_19.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|The same as previously, tick permissions for '' 'user_impersonation' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_20.png]] | ||
+ | |} | ||
+ | --> | ||
+ | {| | ||
+ | |style="padding: 0px 0px 15px 15px;"|After adding permissions, you should see the same result as below. <br/> | ||
+ | Finally, do not forget to click on '' 'Grant admin consent for <your company name>' ''. <br/> | ||
+ | |||
+ | '' '''Note:''' In theory, it is possible to generate Key Vault with only one application, that combines all the previously granted permissions for two applications in one.<br/> However, while testing and in test environments, we encountered problems, that is why we recommend using two separate applications. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_21.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|Now, move to the '' 'Key Vaults' ''section. The fastest way is to use the search engine. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_22.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 15px 15px;"|If you do not have Key Vault yet, you can create it here by following the on-screen instructions. <br/> Add a name, subscription, region, pricing tier and other targets.<br/>More info about creating and using Azure Key Vault, can be found [https://docs.microsoft.com/en-us/azure/key-vault/ here].<br/> | ||
+ | |||
+ | If you already have Key Vault generated, select it from the list. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_23.png]] | ||
+ | |} | ||
+ | {| | ||
+ | <div id="keyvault"></div> | ||
+ | |style="padding: 0px 0px 15px 15px;"|Finally, when you open Key Vault, write down the generated: | ||
+ | * '''DNS Name''' - but without the'' 'https://' '' part | ||
+ | * '''Directory ID''' | ||
+ | which are needed to configure the server in WHMCS properly. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 30px 25px;"|[[File:O2_API_24.png]] | ||
+ | |} | ||
+ | |||
+ | ===Registration of Application in Microsoft Partner Center=== | ||
+ | {| | ||
+ | |style="padding: 10px 0px 15px 15px;"|Lastly, once two applications in Microsoft Azure and Key Vault are ready, you need to register the first created application in Microsoft Partner Center.<br/> | ||
+ | |||
+ | Log in to the dashboard of [https://partner.microsoft.com/en-us/dashboard/directory Partner Center], and then go to'' 'Partner Settings' '' from the dropdown menu in the top right corner.<br/> | ||
+ | |||
+ | '' '''Note:''' To log in, use the account where the first application was created.'' | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_25.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|From the '' 'Account Settings' '' submenu, choose'' 'App Management' '', and for the '' 'Web App' '' type, click on '' 'Register Existing App' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_26.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 15px;"|On the list, find the first created application in Microsoft Azure in the previous steps of this manual and click '' 'Register your app' ''. | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 20px 25px;"|[[File:O2_API_27.png]] | ||
+ | |} | ||
+ | {| | ||
+ | |style="padding: 0px 0px 30px 15px;"|From now on, your application should be properly registered in Microsoft Partner Center, and you already have all the data required to connect the module to API. | ||
|} | |} | ||
Line 187: | Line 421: | ||
{| | {| | ||
|style="padding: 10px 0px 15px 15px;"|'''7. To begin, you must add a new server.'''<br /> | |style="padding: 10px 0px 15px 15px;"|'''7. To begin, you must add a new server.'''<br /> | ||
− | Go to '' 'Setup' '' → '' 'Products/Services' '' → '' 'Servers' '' and press '' 'Add New Server'. '' | + | Go to '' 'Setup' '' → '' 'Products/Services' '' → '' 'Servers' '' and press '' 'Add New Server'. ''<br/> |
+ | |||
+ | '' '''Note:''' If you have WHMCS V7.8.X or later, we recommend using your ''' 'previous experience' ''' of the server configuration instead of the new wizard tool.'' | ||
|} | |} | ||
{| | {| | ||
Line 193: | Line 429: | ||
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px 15px 15px;"|'''8. | + | |style="padding: 0px 0px 15px 15px;"|'''8. When the server configuration page opens, enter a server name at first.''' |
− | + | ||
− | + | '' '''Note:''' The 'Hostname' field is not used by the module, but if you use WHMCS V7.8.X, then a fatal error may occur when trying to save server settings without it providing any hostname or IP address details.<br/>In this case, try to provide anything in the hostname field. Please note that this is a bug occurring in WHMCS, not the module itself, and it may also occur in further versions of WHMCS.'' | |
+ | |||
+ | Next, choose '' 'Office365' '' from the dropdown menu.<br/> | ||
+ | |||
+ | The'' 'Username' '' and '' 'Password' '' fields should be felt empty- they are not used by the module.<br/> | ||
+ | |||
+ | Now, fill in the previously [[#Obtaining_API_Details|obrained API data]]. They are as follows: | ||
+ | |||
+ | * '''APP ID''' - is the '''Application (client) ID''' <u>of the first</u> application that you created [[#app1_details| here]] | ||
+ | * '''APP Secret''' - stands for the '''Client secret''' <u>from the first</u> application which was generated [[#app1_secret| here]] | ||
+ | * '''Common Name / Tenant ID''' - is the '''Directory (tenant) ID''' <u>of the first</u> created application [[#app1_details| here]] | ||
+ | * '''Key Vault APP ID''' - stands for the '''Application (client) ID''' <u>of the second</u> application that you formed[[#app2_details| here]] | ||
+ | * '''Key Vault Secret ID''' - is the '''Client secret''' <u>from the second</u> application that was established [[#app2_secret| here]] | ||
+ | * '''Key Vault Directory ID''' - is the '''Directory ID''' from <u>Key Vault</u> that you might have received [[#keyvault| here]] | ||
+ | * '''Key Vault Domain''' - is the '''DNS Name''' from <u>Key Vault</u> (but '''without''' the '''https://''' part) that you may have got [[#keyvault| here]] | ||
+ | After completing the data, remember to ''' '' 'Save Changes' '' '''. <br/> | ||
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px 20px 25px;"|[[File: | + | |style="padding: 0px 0px 20px 25px;"|[[File:O2_8_1.png]] |
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px 15px 15px;"| | + | |style="padding: 0px 0px 15px 15px;"|You will be redirected to your Microsoft account for a moment.<br/> |
− | + | Use the same data as for the Azure account, on which you generated <u>the first</u> application.<br/> | |
+ | Finally, you will be asked to grant access to your account - '''agree'''. <br/> | ||
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px 20px 25px;"|[[File: | + | |style="padding: 0px 0px 20px 25px;"|[[File:O2_9_login.png]] |
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px | + | {| |
+ | |style="padding: 0px 0px 15px 15px;"| If everything proceeded correctly, you will be redirected to your WHMCS again.<br/> | ||
+ | Now, you can run the test connection of your server to make sure that all data is proper. | ||
|} | |} | ||
{| | {| | ||
− | |style="padding: 0px 0px 20px 25px;"|[[File: | + | |style="padding: 0px 0px 20px 25px;"|[[File:O2_9.png]] |
|} | |} | ||
{| | {| | ||
Line 343: | Line 597: | ||
{| | {| | ||
|style="padding: 0px 0px 15px 15px;"| | |style="padding: 0px 0px 15px 15px;"| | ||
− | + | The standard provisioning type does not support any additional features in the client area.<br /> | |
The customer can order additional services to their subscription, change their password to the [https://www.office.com Office 365] panel, upgrade a subscription plan or request a service cancellation. | The customer can order additional services to their subscription, change their password to the [https://www.office.com Office 365] panel, upgrade a subscription plan or request a service cancellation. | ||
|} | |} | ||
Line 352: | Line 606: | ||
==Extended Provisioning Type== | ==Extended Provisioning Type== | ||
{| | {| | ||
− | |style="padding: 10px 0px 15px 15px;"| | + | |style="padding: 10px 0px 15px 15px;"|The extended provisioning type allows your client to order the chosen number of licenses using configurable options and then manually redistribute them in their client area among the created Office 365 users.<br/> |
Enable this configuration type by choosing the '' 'Extended' '' provisioning type in the module settings of the product. | Enable this configuration type by choosing the '' 'Extended' '' provisioning type in the module settings of the product. | ||
|} | |} | ||
Line 554: | Line 808: | ||
=Tips= | =Tips= | ||
{| | {| | ||
− | |style="padding: 10px 0px 10px 15px;"|'''1. For more information on how the Microsoft Partner program works, | + | |style="padding: 10px 0px 10px 15px;"|'''1. For more information on how the Microsoft Partner program works, check [https://partner.microsoft.com/en-us/membership/how-it-works here].''' |
|} | |} | ||
{| | {| |
Revision as of 13:12, 19 November 2019
Article update is ongoing on this page, watch out for broken links, unclear descriptions and images!
We are sorry for the inconvenience caused.
Contents |
About Office 365 For WHMCS
Office 365 For WHMCS has been designed to let you automatically provision Microsoft Office 365 plans and remotely manage their key features. With this module, you will easily supervise all subscriptions, perform switches and suspensions as well as password changes right in your WHMCS. |
- Admin Area Features:
✔ Create/Suspend/Unsuspend Office 365 Subscriptions |
✔ Choose Standard/Extended Provisioning Type |
✔ Create/Suspend/Unsuspend Addon Services For Standard Provisioning Type |
✔ Create Office 365 Customer During First Or Every Order |
✔ Create Office 365 Client During First Or Every Order |
✔ Define Number Of Subscriptions Available For Order |
✔ Change Package |
✔ Change Password |
- Client Area Features:
✔ Standard Provisioning Type: |
✔ Automatically Create Office 365 Customer/User/Subscription |
✔ Upgrade/Downgrade Office 365 Subscriptions |
✔ Extended Provisioning Type: |
✔ Order Chosen Number Of Subscriptions |
✔ View/Create/Delete Office 365 Users |
✔ Assign Available Subscriptions To Users |
✔ View Subscriptions Usage, Status And Commitment End Date |
✔ Upgrade/Downgrade Number Of Office 365 Subscriptions |
✔ Change Password |
- Supported Services:
✔ Office 365 Education/Education E5 |
✔ Office 365 Business/Business Essentials/Business Premium |
✔ Office 365 ProPlus/Enterprise E1/E3/E5/K1 |
✔ Standalone Services: |
✔ Business Intelligence Service |
✔ Exchange Online |
✔ Information Rights Management |
✔ Office Applications |
✔ OneDrive For Business |
✔ Online Diagram Software |
✔ Project Portfolio Management |
✔ SharePoint Online |
✔ Skype For Business Online |
✔ Yammer |
- General Info:
✔ Requires Microsoft Partner Network |
✔ Requires Microsoft Cloud Solution Provider - Direct (Tier 1) Model |
✔ Supports PHP 5.6 Up To PHP 7.2 |
✔ Supports WHMCS Template Six |
✔ Supports WHMCS V7.2 And Later |
✔ Easy Module Upgrade To Open Source Version |
Installation
Please be informed that Office 365 For WHMCS 2.X is not compatible with its 1.0 version due to the changes introduced to the creation process of subscriptions and users.
If the mechanism available in the 1.0 version suits your requirements, do not update your module to the latest version.
This tutorial will show you how to successfully install and authenticate Office 365 For WHMCS. We will guide you step by step through the whole installation and configuration process. Note: If you still use Office 365 For WHMCS version 1.0.0, read about it here. |
1. Log in to our client area and download the module. |
2. In the downloaded file you will find two packages that support different PHP versions. As presented on the screen below, the first one is dedicated to PHP 5.6 up to PHP 7.0, while the second one is aimed at PHP 7.1 up to PHP 7.2. It does not apply to open source versions. Note: You can check the current PHP version in your WHMCS. To do so, proceed to 'Utilities' › 'System' › 'PHP Info'. |
3. Extract the downloaded file and choose the one with the right PHP version. Upload and extract the PHP file into the main WHMCS directory. The content of PHP version files should look like this. |
4. When you install Office 365 For WHMCS for the first time, you have to rename the 'license_RENAME.php' file. The file is located in 'modules/servers/office365/license_RENAME.php'. Rename it from 'license_RENAME.php' to 'license.php'. |
5. In order to configure your license key, you have to edit the previously renamed 'license.php' file. Enter your license key between quotation marks as presented on the following screen. You can find your license key in our client area → 'My Products'. |
6. Now, set up the 'storage' folder as recursively writable. This folder is located in 'your_whmcs/modules/servers/office365'. |
Obtaining API Details
Before you start to configure the server, you need to obtain some neccessary data to connect to API. The data you need:
In the next steps, we will guide you through the process of getting the data. Note: All of the following data is only an example, so please be aware that some discrepancies can appear on the screens below. |
Creating Application in Microsoft Azure
The first step is to create an application in your Azure Active Directory if you do not have it yet. Log in to your panel in Microsoft Azure. |
On the newly opened page, choose 'App registrations' from the left menu, and then click on 'New registration' . |
Enter an application name on the newly opened page. Leave the selected by default 'Supported account types' unchanged . Later, you need to provide the web 'Redirect URI' . This address must directly lead to the 'auth.php' file located in the folder with the module on your WHMCS server. For example: https://my-whmcs.com/modules/servers/office365/auth.php Please make sure that it is correct and reachable from outside - your WHMCS server must accept SSL connections. |
After clicking on the 'Register' button, you will be redirected to the page that generated your application data.
There you will find:
Write it down, as you will need it afterwards to configure the server in WHMCS. |
Next, go to the 'Certificates & secrets' tab from the side menu and click on 'New client secret' . |
Before adding, provide it with a description and set 'never' in the 'Expire' option. |
A new Client Secret will be created. Copy it to a safe place, as you will need it later for the server configuration in WHMCS. Important: Copy the new client secret value now. You will not be able to retrieve it after you perform another operation or leave this blade! |
Now, you need to set appropriate permissions. To do so, move to the 'API permissions' tab and click on 'Add a permission' . |
Choose 'APIs my organization uses' and then 'Microsoft Partner Center' from the list. |
Tick the 'user_impersonation' permission and click on 'Add permissions' . |
After adding permissions, click again on 'Add a permission' and then, from the 'Microsoft APIs' tab, choose 'Microsoft Graph' |
Select the 'Delegated pemissions' type as well as find and tick 'offline_access' on the list. |
Moreover, on the same list, find and mark 'User.Read' and finally click on 'Add permissions' . |
Lastly, the scheme of allocated permissions should look as presented below. If it is correct, click on 'Grant admin consent for <your company name>' and confirm this action. |
Creating Key Vault
The final step in getting the data needed to connect to API is to generate Key Vault. Azure Key Vault is a cloud service used to manage keys, secrets, and certificates. To create Key Vault, you will need the application again, but this time with other permissions. Note: Key Vault can be generated in another Microsoft account, including live environment, if it turns out that you do not have access to it for some reasons, for example from your test environment. At the beginning, follow the same steps as when setting up the application in Microsoft Azure. That is:
Here, the differences appear, because Application For Key Vault demands different permissions. This is:
As before, let's add permissions. |
Select 'Azure Key Vault' from 'Microsoft APIs' . |
Next, tick 'user_impersonation' . |
After adding permissions, you should see the same result as below. Finally, do not forget to click on 'Grant admin consent for <your company name>' . Note: In theory, it is possible to generate Key Vault with only one application, that combines all the previously granted permissions for two applications in one. |
Now, move to the 'Key Vaults' section. The fastest way is to use the search engine. |
If you do not have Key Vault yet, you can create it here by following the on-screen instructions. Add a name, subscription, region, pricing tier and other targets. More info about creating and using Azure Key Vault, can be found here. If you already have Key Vault generated, select it from the list. |
Finally, when you open Key Vault, write down the generated:
which are needed to configure the server in WHMCS properly. |
Registration of Application in Microsoft Partner Center
Lastly, once two applications in Microsoft Azure and Key Vault are ready, you need to register the first created application in Microsoft Partner Center. Log in to the dashboard of Partner Center, and then go to 'Partner Settings' from the dropdown menu in the top right corner. Note: To log in, use the account where the first application was created. |
From the 'Account Settings' submenu, choose 'App Management' , and for the 'Web App' type, click on 'Register Existing App' . |
On the list, find the first created application in Microsoft Azure in the previous steps of this manual and click 'Register your app' . |
From now on, your application should be properly registered in Microsoft Partner Center, and you already have all the data required to connect the module to API. |
Configuration of Server
7. To begin, you must add a new server. Go to 'Setup' → 'Products/Services' → 'Servers' and press 'Add New Server'. Note: If you have WHMCS V7.8.X or later, we recommend using your 'previous experience' of the server configuration instead of the new wizard tool. |
8. When the server configuration page opens, enter a server name at first.
Note: The 'Hostname' field is not used by the module, but if you use WHMCS V7.8.X, then a fatal error may occur when trying to save server settings without it providing any hostname or IP address details. Next, choose 'Office365' from the dropdown menu. The 'Username' and 'Password' fields should be felt empty- they are not used by the module. Now, fill in the previously obrained API data. They are as follows:
After completing the data, remember to 'Save Changes' . |
You will be redirected to your Microsoft account for a moment. Use the same data as for the Azure account, on which you generated the first application. |
If everything proceeded correctly, you will be redirected to your WHMCS again. Now, you can run the test connection of your server to make sure that all data is proper. |
9. Once your server has been configured correctly, you will see the following screen. Create a new group for your server. Press 'Create New Group' to follow. |
10. Enter a name, click on your previously created server, press 'Add' , then 'Save Changes'. |
Configuration of Product
11. In order to create a product, go to 'Setup' → 'Products/Services' → 'Products/Services' . If you do not have a product group, click on 'Create a New Group' . If you do, simply move to the 12th step. |
12. Fill in a product group name and press 'Save Changes'. |
13. When you have a product group added, you can create your product and assign it to the Office 365 module. |
14. Afterwards, choose your product type and product group from dropdown menus, enter your product name and press 'Continue' . |
15. Now, go to the 'Module Settings' section, choose both 'Office365' and the previously created server group from the dropdown menu, and press 'Save Changes' . |
16. Then, go to the 'Custom Fields' tab and make sure that it displays the three created 'text box' custom fields. These are: userid|User ID, orderid|Order ID and customerid|Customer ID. If they were not automatically created, then add them manually as shown on the following screen. |
Configuration and Management
Configuration and management of Office 365 For WHMCS is very intuitive. Before you start, please note that there are two provisioning types you can offer to your clients.
|
Standard Provisioning Type
Let's start the module configuration by choosing the 'Standard' provisioning type. |
Now, choose 'Country'. that you will offer your Office 365 services from. Note: Available subscription offers and additional services depend on your Microsoft membership coverage and may be limited by the location. |
Additional Services
In order to offer additional services for a standard product plan, you need to create a new addon first. Important: addons are applicable only to standard provisioning types, not to extended ones. |
Enter a name of the addon, choose the addon to be visible during the ordering process and configure the rest of the desired options. |
Go to the 'Applicable Products' tab and select the product that you want to offer this addon for. Then press 'Save Changes' . |
Important! Please leave both: 'Module Name' and 'Server Group' set to NONE in the addon module settings. Selecting any server or module here will surely end up with an error! |
Go back to your product and connect the created addon with one of the available additional services in the 'Module Settings' tab. |
Finally, 'Save Changes' . Remember that you can also add more addons for services. |
Client Area
Once the product configuration is complete, clients will be able to order the selected subscription and addons. |
The standard provisioning type does not support any additional features in the client area. |
Extended Provisioning Type
The extended provisioning type allows your client to order the chosen number of licenses using configurable options and then manually redistribute them in their client area among the created Office 365 users. Enable this configuration type by choosing the 'Extended' provisioning type in the module settings of the product. |
Now, choose 'Country' that you will offer your Office 365 services from. |
Configurable Options
To allow your clients to purchase multiple licenses at a single order, you must create configurable options for a product . Start by going to 'Setup' → 'Products/Services' → 'Configurable Options' and press the 'Create a New Group' button. |
Enter a group name for the addon and select products that you want to offer this option for. Then press the 'Save Changes' option. |
Now, press 'Add New Configurable Option' and a new popup window should open. |
Name this configurable option as 'office365licenseQty' with the desired friendly name. Next, chose the 'Option Type' you want to use and add pricing for the desired quantity. Note: More information about setting up configurable options can be found here. |
Client Area
Once the product configuration is complete, clients will be able to order the selected number of subscriptions. |
After order your clients will be able to manage Office 365 users and subscriptions by themselves. The menu also displays information about the current number of used subscriptions. |
Before you start assigning subscriptions, you have to create new users. By default there is already one Office 365 user created based on the customer account. |
Fill in the required data to create a new user. |
Then, after successfully creating a new user, you can view their account details. |
In the user profile you can view account details as well as assigned subscriptions. Press the 'Add Subscriptions' button to assign a new license to this account. |
You can assign multiple licenses to one account, provided that the number of used subscriptions is not exceeded already. |
After successfully adding licenses to user account you will see their number, status and validity in the user's 'Subscriptions' box. |
The 'Subscriptions' section displays all product licenses that are currently assigned to a user. For your convenience, if product settings have been configured to create only one Office 365 customer per WHMCS client, then all other purchased subscription types will also be displayed here. |
If you are using the module, we do not recommend assigning subscription directly from the Microsoft panel. However, if such a situation occurrs, the subscription will be fetched to the WHMCS list, but then you will have to assign it to the user manually. |
In the newly opened window select the user to whom the subscription will be assigned and press the 'Assign' button. |
Admin Area
Let's check your new product in the product page in admin area . After a successful creation, it should look exactly like presented on the screen below. Note The admin area for both standard and extended provisioning types looks basically the same. |
The 'Username' and 'Password' are used to sign up to the Office 365 panel. |
The 'User ID' , 'Order ID' , 'Customer ID' and 'Subscription ID' are custom fields used to connect the product with the created subscription in your Microsoft Partner Center. |
Suspend/Terminate
Due to API limitations, ordered subscriptions can only be suspended or unsuspended. For this reason, the 'Terminate' command will work in the same way as the 'Suspend' option. |
In case of standard product suspension, all addons that belong to the product will also be suspended. If the product is unsuspended, its addons will remain suspended. |
Change Password
The 'Change Password' option will change the password for all services assigned to the user. To change it into a new one, you need to:
|
Note that the password must also meet the following requirements:
|
Product Upgrade/Downgrade
By using upgrade/downgrade feature you can change the subscription type for the standard provisioning type. However, for the extended provisioning type you can only change the number of assigned licenses by configurable options, not the subscription type itself. |
Addons
Information about addons will depend on their status and will be shown in the 'Admin Notes' field. By default, the 'Subscription ID' service should be provided. Note that the addon can only be used for the standard provisioning type. |
For example, if the addon is suspended, the information will also appear in this field. |
Tips
1. For more information on how the Microsoft Partner program works, check here. |
2. API responses can be translated in the module's language file. To do this, add a new record in the file with the received API message and your translation. See below to find an exemplary entry: $_LANG['ApiResponse']['Can\'t contain username paramName: User.Password, paramValue: , objectType: System.String'] = 'Password field cannot contain a username.'; |
Update Instructions
An essential guidance through the process of updating the module is offered here. Keep in mind there is a quick and easy option in our client area that will let you upgrade the license of your module to an open source version at any time - and at a lower price! |
Migration
While using the 2.X version of our module, note that no data can be migrated from the Office 365 For WHMCS version 1.0.0, so the module needs to be configured from scratch. This also means that previously placed orders for subscriptions will not work on the new version, even after module reconfiguration. |
Common Problems
1. When you have problems with connection, make sure that SELinux or firewall does not block ports. |
2. The list of users and their subscriptions assigned to the customer directly in the Microsoft panel are not automatically assign to the WHMCS client and their users. This is due to the API limitations, so this list is only kept locally on the WHMCS server. |
3. This error encountered in the module:Use limit is exceeded for Offer Id indicates that a single customer may purchase only one license (e.g. Office 365 Business, Office 365 Business Essentials, Office 365 Business Premium license). |