Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with professional (office 365) accounts #18

Open
vicenteribes opened this issue Nov 25, 2019 · 3 comments
Open

Does not work with professional (office 365) accounts #18

vicenteribes opened this issue Nov 25, 2019 · 3 comments

Comments

@vicenteribes
Copy link

I have used this plugin in a project, and worked perfect with personal microsoft accounts (free outlook.com accounts) but couldn't work with professional (office 365 accounts)

I have edited /src/Provider/Microsoft.php
changing the following lines:

protected $urlAuthorize = 'https://login.microsoftonline.com/common/oauth2/authorize';
protected $urlAccessToken = 'https://login.microsoftonline.com/common/oauth2/token';

and now works with both personal and professional accounts.

Just to inform any other guy with the same issue.

@stevenmaguire
Copy link
Owner

stevenmaguire commented Nov 25, 2019

@vicenteribes thanks for this. If this is a verifiable change (and maintains support for non-O365 microsoft accounts like hotmail/live accounts assuming they are still supported), I am happy to accept a PR with this permanent change, along with updated passing tests.

@ander1980
Copy link

Gostaria de contribuir,

Caso não tenha conta corporativa da Microsoft, essa rotina funciona com contas de e-mails comuns usando o login live.com:

$ provider = novo Stevenmaguire \ OAuth2 \ Client \ Provider \ Microsoft ([
// Necessário
'clientId' => '{seu cliente-id na conta do Azure.',
'clientSecret' => 'seu cliente-secreto usando o Azure' ,
'redirectUri' => 'seu link de retorno, deve estar idêntico à conta do Azure',
'urlAuthorize' => 'https://login.live.com/oauth20_authorize.srf',
'urlAccessToken' => 'https://login.live.com/oauth20_token.srf',
//'urlResourceOwnerDetails' => 'https://login.live.com/' //Deprecated
]);
É necessário criar como configurações de aplicativo no Azure:
https://portal.azure.com/#home
Localize -> Serviços de aplicativos -> Gerenciar o Diretório Ativo do Azure
Localize -> Registros de aplicativos na barra lateral.
Crie seu novo registro de aplicativo, ID do cliente, segredo do cliente, tokens de acesso de permissão, etc.

@Dasc3er
Copy link

Dasc3er commented Oct 8, 2020

@stevenmaguire The solution suggested by @vicenteribes should be correct, as officially published by Microsoft itself: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

More than that, I just verified the connection with a personal account and with a change on the scope separator this library works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants