Closed brian2github closed 6 years ago
Please share more of the code that is interacting with the package.
@brian2github @stevenmaguire Same problem for me, code like that one, any solution? thanks
I'm trying to Connect to Microsoft Dynamics 365 web services using OAuth, have tried this code and can't get it to work yet, has anyone been successful in connecting and using the Web API?
@jcrumpOS On this list https://github.com/thephpleague/oauth2-client/blob/master/docs/providers/thirdparty.md this one is not working for me,and for what i have read,for no one. Use Azure Active Directory Oauth from this list https://github.com/thenetworg/oauth2-azure , that one worked for me like a charm :) , hope this will help u
@oabreu is on the right track. Microsoft is a large organization and they offer several APIs and Authorization flows. Consider trying the other Microsoft specific oauth2 libraries.
Thanks, I've tried that and get the same message:
Fatal error: Uncaught exception 'League\OAuth2\Client\Provider\Exception\IdentityProviderException' with message 'Unauthorized'
@jcrumpOS have you attempted your auth flow using the azure specific oauth2 library?
Thanks, yes it's working now.
Not sure if an issue or I just need help in troubleshooting...
[24-Aug-2017 05:15:56 UTC] PHP Fatal error: Uncaught exception 'League\OAuth2\Client\Provider\Exception\IdentityProviderException' with message 'Bad Request' in /home/(user)/vendor/stevenmaguire/oauth2-microsoft/src/Provider/Microsoft.php:79 Stack trace:
0 /home/(user)/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(613): Stevenmaguire\OAuth2\Client\Provider\Microsoft->checkResponse(Object(GuzzleHttp\Psr7\Response), Array)
1 /home/(user)/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(528): League\OAuth2\Client\Provider\AbstractProvider->getParsedResponse(Object(GuzzleHttp\Psr7\Request))
2 /home/(user)/public_html/oauth-test/test.php(62): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken('authorization_c...', Array)
3 {main}
thrown in /home/(user)/vendor/stevenmaguire/oauth2-microsoft/src/Provider/Microsoft.php on line 79
What is happening is that I launch my PHP, it redirects to MS for login. I login, and it redirects me back to my page with additional query string info. At that point I get the error above.