“This is the 10th day of my participation in the First Challenge 2022. For details: First Challenge 2022”

Join the Office 365 developer program

The computer crashed for many times, and I reinstalled the computer in a fit of anger, only to find that all the Microsoft services I sent before were invalid. I heard about the Office 365 developer plan earlier, so I started to operate it myself

Step-by-step instructions

<1> Register a Microsoft account and join the Developer program

<2> download Microsoft365, log in, and activate

<3> Automatic continuation: Maintain developer identity

Refer to the steps

Visit the Microsoft Office Developer Center, click the “Join now” button on the home page, register -> Sign in, and fill in the information

Set the E5 sandbox (you can customize the sandbox). After setting the sandbox, you can see the following information

Install and activate Microsoft365

Method 1: Click to subscribe in the above dashboard, then log in with the administrator account just generated, and enter the page to download the required content

Method 2: Use Office Tool Plus to install and deploy the software

After the installation is complete, the software can be normally activated by login account (login is required through the developer account (administrator) constructed by the above application). After login, you need to download Microsoft Authenticator for permission verification and management according to prompts. After registration and verification, the account will be activated successfully (subsequent activities related to the account can be authorized through software)

Automatic renewal

Automatic renewal

The default Office 365 developer subscription is 90 days, which must be renewed for further use. Microsoft will verify whether the account has applied the relevant API applications and services provided by Microsoft to check the identity of the developer

Automatic renewal projects include online projects and local software. The main ideas are as follows

  • Register an Azure application and apply for an API

  • Authorization projects/programs automatically invoke the application API under the account

Create the registration application [apply under Azure Background Dashboard], invoke Office365 Outlook mailbox interface, Azure Active Directory/Microsoft Identity account login interface, and Microsoft Graph interface

Reference items

1.E5 automatic renewal project

E5 automatic renewal project is an online renewal project developed by @luoye663 on Github. It is built on the server of the author, and you need to configure the API and key of the application according to the tutorial. After that, you need to visit and log in the website set up by the author (using the Github account), and authorize the application client.

2.Microsoft 365 E5 Renew Plus

Microsoft 365 E5 Renew Plus is a Windows desktop tool developed by CSDN blogger SundayRX specially for E5 automatic renewal. It enhances the activity of developer account by automatically calling API, so as to automatically Renew E5.

A. Azure Application registration

Log in to Microsoft Azure using your developer account ([email protected]) (or register your Azure application directly)

Application of registration

  • Registration application

  • Fill in the name, supported account type, and register first (configure the rest later)

Application configuration

After registration is complete, click Overview (Home page -> Application Registration -> Overview) to view application details, choose Add Weighting URI > Platform Configuration > Add Platform

Go ahead and select the URL (or you can customize it manually), then click Configure authentication to update

Allows public client streams -> Click the Toggle button to save later

API Permission Configuration

There are two types of registered application API permissions, and the main differences are shown in the following table:

Permission types Delegated permissions (user login) Application permissions (non-user login)
The official definition The application must access the API as a logged-in user The application runs as a background service or daemon without the user logging in
The required configuration Account name + Account password + application (client)ID Account name + client secret + application (client)ID
Function effect All apis in the program can be called Some APIS cannot be called due to limited permissions (official restrictions)
API Permission Configuration Add API permissions automatically configured by PC version program API permissions must be manually configured

You can select the corresponding API for configuration

Using The Microsoft Graph as a reference, select “Delegate Permissions” and choose from the list of API permission requirements

  • Delegate Permissions configuration (User login) (choose suffixes -> suffixes.Read)

  • Application Permissions Configuration (non-user login) (choose suffixes -> suffies.read)

  • Client password creation: Certificate and Password -> Add client password

You can see the generated record in the list, click to select the copy value (client password)

B. API Invokes the tool

The Microsoft Graph Browser is a Web-based tool that can be used to generate and test requests for the Microsoft Graph API

The permissions required by the API can be looked up in the preview card, and the response can be tried again after authorization

Postman is a tool that can be used to make requests to the Microsoft Graph API: Postman&Microsoft Graph API

C. icrosoft Graph quick start example

Getting started with Microsoft Graph:

A. Select a language or platform b. Obtain the application ID (client ID) c. Generate example d. Log in and then view events on the calendarCopy the code

The PHP sample

Register the PHP application and download the sample application

Install the Composer directive, then run the project locally

  • Unzip the downloaded package into a directory, then go to the Graph-tutorial directory on the command line interface

  • The inputcomposer installInstall project dependencies
// You can use the following command to temporarily ignore version requirements: composer install --ignore-platform-reqsCopy the code
  • Generating application keys
php artisan key:generate
Copy the code
  • Starting the Web Server
php artisan serve
Copy the code
  • Go to http://localhost:8000