MS Account Local plugin for Moodle LMS
Перейти к файлу
microsoft-github-policy-service[bot] 85369a06fc
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-13 17:54:36 +00:00
classes MSFTMPP-572: Shorten table name to match restrictions 2016-09-01 12:55:04 -04:00
db MSFTMPP-572: Shorten table name to match restrictions 2016-09-01 12:55:04 -04:00
lang MSFTMPP-405: Update references to Microsoft Open Technologies to read Microsoft, update documentation links. 2016-03-24 01:15:00 -04:00
pix MSFTMPP-64: Added official icon to local_msaccount 2015-01-16 16:02:09 -05:00
.travis.yml POET - Modifying database table name to comply with Moodle guidelines. 2016-08-31 03:01:12 -04:00
LICENSE MSFTMPP-64: Added LICENSE files 2015-01-16 19:55:55 -05:00
README.md MSFTMPP-594: Updated plugin READMEs to add support expand contributing sections 2016-11-10 14:40:40 -05:00
SECURITY.md Microsoft mandatory file 2023-06-02 22:02:13 +00:00
login.html code style changes in local/msaccount plugin 2014-12-18 18:59:46 +05:30
msaccount_redirect.php MSFTMPP-405: Update references to Microsoft Open Technologies to read Microsoft, update documentation links. 2016-03-24 01:15:00 -04:00
settings.php MSFTMPP-472 - Improvements based on Office 365 + MS Services review 2016-05-12 14:50:46 -04:00
styles.css fixed CSS names to bring them in line with coding style guideline 2015-01-14 11:37:52 +05:30
version.php MSFTMPP-574: Update version files (v20160831_m31) 2016-09-01 02:16:03 -04:00

README.md

Moodle Plugins for Microsoft Services

including Office 365 and other Microsoft services

Microsoft Account API Local Plugin

This plugin provides a simple client API for OAuth2-based authentication and token management for Microsoft Account. It also provides some helper functions for making REST API calls to services that use the Microsoft Account.

Usage

Instantiation: $msaccountapi = \local_msaccount\api::getinstance();

Logging the user in: $msaccount_api->is_logged_in();

Making a REST API call: $response = $msaccount_api->myget($url);

Design details

There are several parts that make up the Microsoft Account API plugin.

Configuration

This allows an administrator to specify OAuth2 settings such as client id and secret for the Microsoft Account application associated with this Moodle installation.

local_msaccount\api class

This is a singleton class that provides simple wrappers for various methods provided by the local_msaccount\client class. Please use this class for accessing all the functionality provided by the local_msaccount\client class.

local_msaccount\client class

Note: Please do not use this class directly. Instead, use the local_msaccount\api class described above.

This class is derived from Moodle's oauth2_client class and:

  • adds support for retrieving and saving refresh tokens and logging in using the refresh token if the main token expires.
  • this also becomes useful for automated unit testing because we can use the refresh tokens to log users in automatically.
  • works around an issue in the oauth2_client where it sets the token in the header only if it thinks that it is making a post request, but the Microsoft Account REST API needs auth token in the header for get as well as post requests.

This is part of the suite of Microsoft Services plugins for Moodle.

This repository is updated with stable releases. To follow active development, see: https://github.com/Microsoft/o365-moodle

Installation

  1. Unpack the plugin into /local/msaccount within your Moodle install.
  2. From the Moodle Administration block, expand Site Administration and click "Notifications".
  3. Follow the on-screen instuctions to install the plugin.

For more documentation, visit https://docs.moodle.org/30/en/Office365

Support

If you are experiencing problems, have a feature request, or have a question, please open an issue on Github at https://github.com/Microsoft/o365-moodle.

To help developers debug problems, please include the following in all issues:

  • Plugin versions.
  • Moodle version.
  • Detailed instructions of what went wrong and how to reproduce the problem.
  • Any error messages encountered.
  • PHP version.
  • Database software and versions.
  • Any other environmental information available.

Note that developers will triage issues and deal with more serious problems first. All issues will be addressed but some may not be addressed immediately.

Contributing

We're looking for community contributions! Feel free to submit pull requests, but please do so against the development repository at https://github.com/Microsoft/o365-moodle. Pull requests submitted to individual plugin repositories cannot be accepted.

Needed Contributions

Smaller issues that developers cannot address right away will be labeled with "Help Wanted" in the issue tracker in the development repository at https://github.com/Microsoft/o365-moodle/issues. These are only suggestions - we can also accept pull requests fixing other bugs, or even adding new features.

Pull requests adding new features are much appreciated but note that they may be rejected (even if technically sound) if they do not match the direction of the project. If you want to add a new feature, it's best to open an issue outlining your idea first, and get feedback from the maintainers.

Contributions to our documentation are especially appreciated! All documentation lives in the /local/o365docs folder of the development repository (https://github.com/Microsoft/o365-moodle). Updates to this documentation can be sent via pull request like any other contributions.

Code Review

All pull requests go through a thorough examination from developers before they are merged. Please read our code review process and ensure your code is consistent before submitting. A developer may respond with changes that are needed before a pull request can be accepted and it is up to the submitter to make those changes. If accepted, your commit will remain as-is to ensure you get credit, but developers may modify solutions slightly in subsequent commits.

CLA

Finally, before we can accept your pull request, you'll need to electronically complete Microsoft's Contributor License Agreement. If you've done this for other Microsoft projects, then you're already covered.

Why a CLA? (from the FSF)

© Microsoft, Inc. Code for this plugin is licensed under the GPLv3 license.

Any Microsoft trademarks and logos included in these plugins are property of Microsoft and should not be reused, redistributed, modified, repurposed, or otherwise altered or used outside of this plugin.