Skip to content

This FORK repo seems to be working >  #30

@pavletabata

Description

@pavletabata

to save some time of others, as the current repo is abandoned, these repos (updated branches) seem to be up-to-date:

$provider = new Trunkstar\OAuth2\Client\Provider\Microsoft([
	...
	'urlAuthorize'=>'https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize',
	'urlAccessToken'=>'https://login.microsoftonline.com/organizations/oauth2/v2.0/token',
]);

or

i have added those 2 modified files from: https://github.com/oddhill/oauth2-microsoft/tree/support-org-mail/src/Provider

and example use:

               $provider = new Stevenmaguire\OAuth2\Client\Provider\Microsoft([
			'clientId'                  => 'xxx',
			'clientSecret'            => 'xxx',
			'redirectUri'             => 'xxx',
		]);

		if (isset($_GET['error'])) {
			var_dump($_REQUEST);
			exit;
		}
		if (!isset($_GET['code'])) {

			// If we don't have an authorization code then get one
			$options = [
				'state' => 'OPTIONAL_CUSTOM_CONFIGURED_STATE',
				'scope' => ['User.Read'] // array or string
			];

			$authUrl = $provider->getAuthorizationUrl($options);
			// $this->setcookie ('ms_oauth2state',  $provider->getState() );
			header('Location: ' . $authUrl);
			exit;
	      }
	      ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions