Download the PHP package xrh0905/oauth-microsoft without Composer

On this page you can find all versions of the php package xrh0905/oauth-microsoft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package oauth-microsoft

Log In With Microsoft

License Latest Stable Version Total Downloads

Log in to your Flarum forum with Microsoft. An addon for FoF OAuth.

Supports personal Microsoft accounts (Outlook, Hotmail, Live) as well as work and school accounts via Microsoft Entra ID (Azure Active Directory).

See also: https://learn.microsoft.com/zh-cn/entra/identity-platform/v2-protocols-oidc

Installation

Install with composer:

Updating

Setup

1. Register an Application in the Azure Portal

  1. Sign in to the Azure Portal.
  2. Navigate to Microsoft Entra ID → App registrations → New registration.
  3. Fill in the form:
    • Name: anything descriptive, e.g. My Flarum Forum.
    • Supported account types: choose who can sign in (see Choosing a Tenant below).
    • Redirect URI: choose Web as the platform, then paste the callback URL shown in this extension's settings page in your Flarum Admin panel (it looks like https://your-forum.com/auth/microsoft).
  4. Click Register.

2. Obtain the Client ID and Client Secret

  1. On the application's Overview page, copy the Application (client) ID — this is your Client ID.
  2. Go to Certificates & secrets → New client secret.
  3. Enter a description and choose an expiry, then click Add.
  4. Copy the Value immediately (it is only shown once) — this is your Client Secret.

3. Configure the permissions

  1. On application's Authenication → Settings page, make sure to tick ID tokens (used for implicit and hybrid flows) checkbox.
  2. On application's API Permissions page, grant openid profile email under Graph API in Delegated mode.

4. Configure the Extension

In your Flarum Admin panel, go to Extensions → Log In With Microsoft and enter the Client ID and Client Secret obtained above. If you want to restrict sign-in to a specific audience, also set the Tenant field (see below).


Choosing a Tenant

The Tenant field controls which Microsoft accounts are allowed to sign in. It needs to match the settings in Supported account types.

Value Who can sign in
(blank) / common Personal Microsoft accounts and work/school (Azure AD) accounts from any organisation
organizations Work/school (Azure AD) accounts from any organisation only
consumers Personal Microsoft accounts (Outlook, Hotmail, Live) only
A tenant ID (GUID) Only accounts from that specific Azure AD tenant, e.g. xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
A primary domain Only accounts from that Azure AD tenant, e.g. contoso.com

Tip: If your forum is for an organisation and you want to restrict sign-in to your company's Azure AD, set the tenant to your tenant ID or your primary domain. You can find your tenant ID on the Microsoft Entra ID → Overview page in the Azure Portal.

Note: If you set Supported account types to Single tenant in the Azure Portal, you must also set the Tenant field here to your tenant ID or domain, otherwise the authentication endpoint will reject requests.


Links


All versions of oauth-microsoft with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^1.2.0
fof/oauth Version ^1.3.0
thenetworg/oauth2-azure Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xrh0905/oauth-microsoft contains the following files

Loading the files please wait ...