[oAuthMobile] Problem with Sharepoint + oAuth mobile

[oAuthMobile] Problem with Sharepoint + oAuth mobile

  
Forge Component
(1)
Published on 2017-03-10 by Barduino
1 vote
Published on 2017-03-10 by Barduino

I am using OAuth2.0 mobile to  authenticate to Sharepoint.

First I sent GET t(with user credentials) to Sharepoint content server and get http response back.

Then I am parsing it and selecting value of 

Constants.MSA_AUTH_URL = 'https://login.live.com/oauth20_authorize.srf

as 

Authorization_EndPoint

an end of same string (Constants.MSA_AUTH_URL) AFTER question mark:

response_type=code&client_id=51483342-085c-4d86-bf88-cf50c7252078&scope=openid+profile+email+offline_access&response_mode=form_post&redirect_uri=https%3a%2f%2flogin.microsoftonline.com%2fcommon%2ffederation%2foauth2&state=rQIIAZWQsW_TQBjFe3EbKV1AiAmJrSygiz_fd-f4IiE4-85SEAVBBxBL5CY-bOHUJnYh7V-AxNK5AwMTyoQyIf6ETpmRujF0ZkJioRYLI7zh6UlPenr63Xa8vjfcgT9C2joFaz06Sdv0l-bXtq9-uPH502q9cf8tHb57eX793inpjYv8TdqflLMl8bKmqeqh6xbJ7JXN-3WWzNOqzA-atnfHtpzPanea2uSwaPpJXS2-ELIm5IKQZee1kQohklEcDhCECJXigZGScx1FJuYIQWx8EzMRgFJRKKjmcYCBxpD7SiqIMEAd6oHmArRmgAL8EBQEzMQxZ2jEwL8ckFEY-xqZhG-dK4_VYZOx1sp5fpz-6PTaj-OqrJtTh8DS-ScyK2cHUbJ97icUB1ZQbqVHE-ZbymW6P5UgrZTTM6dbVulBPl1vkp-b5OPWJdDi180756vv5v1FUd_axo2zLTcUiwcT1OVitIsv6mcj2DsaHT0STfZ8V9d-NnnK9sA8XOTHsyd3xdA76ZKTbvdr7__h_wY1&estsfed=1&uaid=a8b01a9ed0b24000772d3a8867dd143f

as an 

Authorization_Parameters

and 

<input type="hidden" name="ctx" value="rQIIAZWQMW_TQBiGe3EbqV1AiAmJLV1AF3--787xRaras-8sBVEQdACxVG7iw1aT2o1dkfYXIHXp3IGBCWVCmRA_oVNmpG4MnTtVYqERC2P7Do_e6dWr55njtb1uC_4F6YIUrPVoP120_zJ-tPbwy5Pv32bzpa1PtPv54-XjzSnxsrouq67rDpPRvs3bVZaM07LID-p2vxi5u7YYjyp3kNrkaFi3k6qc_CBkTsgVIdPGoZEKIZJRHHYQhAiV4oGRknMdRSbmCEFsfBMzEYBSUSio5nGAgcaQ-0oqiDBAHeqO5gK0ZoAC_BAUBMzEMWdoRMe_HZBRGPsamYRfjQev1VGdsQWKcX6SXjdWFx93y6Kqzx0CU-dONmZOC1GyPe4nFDtWUG6lRxPmW8plujeQIK2UgwunWZTpQT6YL5ObZfJ15Vbi8M_T55ez3-b0alitr-HSxYobismLPupi0tvGD9W7Huwc945fiTp7v60rP-u_ZTtgXk7yk9GbDdH1zprkrNn8uXp_-X8B0" />

(value part as 

URL_Authorize_Token_String

and value of

 Constants.CANCEL_REDIRECT_URL =

as 

URL_Cancel_Login_String

AND

URL_Cancel_Authorization_String

Result is, that I get error from ms login.live.com, claiming, that client_id parameter should be included, but is was in 

Authorization_Parameters

Logs say that connection 1-4 OK, Then used CTX and Auth params then error.

Attached http response to get and screenshot from logs (not from same session)

Same credentials works fine with browser, so what I am doing wrong here?

(Does same client_id/client secret work with my app, which works with browser login, or is there some actions I need to take with this app?)


I was initially guided to wrong address, so please ignore my post above.  Instead, this might be useful link: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-code