cuongdevjs / reactjs-social-login

Group Hook ReactJS components for login social network
https://react-social-login.netlify.app
MIT License
168 stars 75 forks source link

Microsoft login issue #141

Closed alexandr-reshodko closed 11 months ago

alexandr-reshodko commented 11 months ago

Hi! Thanks for this great plugin.

I have a problem with Microsoft authorization. When I try to login, it successfully gets the token but next request to "https://graph.microsoft.com/v1.0/me" fails with "403 Forbidden". Here is my app permissions

image

P.S. Login with google works without issues

cuongdevjs commented 11 months ago

Please give me your code. make sure you have passed proper scope to LoginMicrosoft

alexandr-reshodko commented 11 months ago
<LoginSocialMicrosoft
    client_id={MICROSOFT_ID || ''}
    redirect_uri={window.location.href}
    onResolve={({ provider, data }) => {
        console.log(provider, data)
    }}
    onReject={(err) => {
        console.log(err);
    }}
>
    <MicrosoftLoginButton />
</LoginSocialMicrosoft>

I'm using default scope

cuongdevjs commented 11 months ago

Have you checked the permission of your app? I mean MICROSOFT_ID. 403 permission code is out of the scope of this library.

alexandr-reshodko commented 11 months ago

I've set scope like this scope={'openid profile User.Read email'} and it worked. Thanks