OfficeDev / skype-web-sdk-simple-sample-for-SfB-online

Other
34 stars 13 forks source link

Getting 401 & 403 when signing in for Skype #2

Open kennyki opened 8 years ago

kennyki commented 8 years ago

Hi there, great sample project you have got here.

While I'm trying to get it working, the first couple of steps were fine, however it returns 401 and 403 when 'Sign-in Skype' button is clicked.

2016-11-07 3 55 40

I have:

2016-11-07 4 30 41

The AAD app manifest:

{
  "appId": "<I suppose this is the clientid>",
  "appRoles": [],
  "availableToOtherTenants": false,
  "displayName": "ringmd-test",
  "errorUrl": null,
  "groupMembershipClaims": null,
  "homepage": "http://upurebjykf.localtunnel.me",
  "identifierUris": [
    "https://rmddev.onmicrosoft.com/c0ef517f-3498-441d-b5ee-b7d8d904d8e2"
  ],
  "keyCredentials": [],
  "knownClientApplications": [],
  "logoutUrl": null,
  "oauth2AllowImplicitFlow": true,
  "oauth2AllowUrlPathMatching": true,
  "oauth2Permissions": [
    {
      "adminConsentDescription": "Allow the application to access ringmd-test on behalf of the signed-in user.",
      "adminConsentDisplayName": "Access ringmd-test",
      "id": "97eaa15b-5158-4141-94d9-f055e6af67e7",
      "isEnabled": true,
      "type": "User",
      "userConsentDescription": "Allow the application to access ringmd-test on your behalf.",
      "userConsentDisplayName": "Access ringmd-test",
      "value": "user_impersonation"
    }
  ],
  "oauth2RequiredPostResponse": false,
  "objectId": "dde7a4cb-6dfa-441a-a49d-32b14784f94c",
  "passwordCredentials": [],
  "publicClient": false,
  "replyUrls": [
    "http://upurebjykf.localtunnel.me/*",
    "http://localhost:8080",
    "https://www.ring.md"
  ],
  ...
}

The config.js:

    ...
    clientid : '<Using the appId in ringmd-test.json>',//client id created in Azure AD
    replyurl : 'http://upurebjykf.localtunnel.me',//replyurl you set in Azure AD
    appName : 'ringmd-test'//Application Name registered in Azure AD
};

Do you have any idea/suggestion of places/steps that I may have mistaken?

Thanks

NT-D commented 8 years ago

@kennyki Thanks for making issue. I'll check and reply later.

thanks, masa

romadenysyuk commented 7 years ago

Hi. I have the same issue no matter using this sdk simple sample or just following the guide from here - https://msdn.microsoft.com/Skype/WebSDK/docs/DevelopWebSDKappsForSfBOnline.

romadenysyuk commented 7 years ago

I found a solution for my problem.

I did everything from scratch following the guide here https://github.com/OfficeDev/skype-web-sdk-simple-sample-for-SfB-online. Created a Microsoft account, got a free O365 tenant, signed up for free Azure Active Directory trial account. Associated my O365 account with Azure AD as described here https://msdn.microsoft.com/en-us/office/office365/howto/setup-development-environment#associate-your-office-365-account-with-azure-ad-to-create-and-manage-apps. Then I registered the new app in Azure Active Directory to use Skype for Business. Then I updated config.js in the skype web sdk simple sample for SfB online application. And again no luck, the same error - 401 - Unauthorized: Access is denied due to invalid credentials.

I was trying to run the index.html page on the localhost in the htdocs/skype directory. Of course I was setting the reply url accordinly as http://localhost/skype/index.html. Then I tried to move everything in skype directory to the root - to the htdocs folder. And also changed reply url to http://localhost/index.html. And very strangly but it helped. Now I can successfully login using Skype WebSDK.

I still don't know the reason for why it is working only this way. If someone have an idea you are welcome to comment.

@NT-D, @kennyki have you found anything or know what is the cause of this behaviour?

ghost commented 7 years ago

Any updates on this issue?

prabhakarreddy1234 commented 7 years ago

Any update on this issue. This issue occurring intermittently . Sometimes i am able to initiate conversation but sometimes not. Also, It is succesful in firefox and not in chrome and sometimes works in chrome but not in firefox at the same time. It's weird.

ghost commented 7 years ago

I can't believe SfB has these issues. How can we confidently implement it to our system if SfB behaves this way? It's so inconsistent and slow. WebRTC is better even if I have to implement it from scratch.....

Recodify commented 7 years ago

I thought I was having the same problem but everything was actually working correctly. I think that the 401 response you see are expected. What happens is:

The above would explain why this appears to be intermittent, if a the client is already authenticated, then you will not see the redirect and will not see a 401 in dev tools.

I believe this perception is made more likely due to subsequent issues with the chat client (which I currently haven't got to the bottom of).

What I would suggested doing: getting to the point where you have received the 401s, open up your dev tools(f12) console and then issue: client.personsAndGroupsManager.mePerson.status you should then get a result that corresponds to your authenticated users SFB status. Change you status using SFB, reissue the command and you will see the change reflected, proving that you have successfully authenticated.

hng94 commented 7 years ago

Guys, I have the same problem. Is there any active microsoft's employee here ? Can you help me to find out what is wrong ?

maxijuice commented 7 years ago

@hoangnguyen94 , you should follow @romadenysyuk 's solution. I've just tried that and it actually helps. Let me try to summarize its main points:

shadab280296 commented 7 years ago

microsoft edge im getting this error shown in above .png file I am not sure about the problem i am facing can anyone suggest how to resolve this issue