OAUTH token to connect to Sharepoint online


(Neil) #1

Hello

I’ve got an issue with OAUTH 2 legged tokens and sharepoint connectivity.

To get a sharepoint access token you need to post the following attributes to the endpoint inside the request body: client_id, client_secret, resource and grant_type. Obviously I can provide the client_id & client_secret but have no idea how to append further information into the body.

Subsequently I get the following in the logs:

0: Oauth2_Token::_parseStoreAccessToken (/var/www/html/wss-template/packages/oauth2/oauth2_token/oauth2_token.inc line 298):
Array
(
[result] => Array
(
[error] => invalid_request
[error_description] => AADSTS90014: The request body must contain the following parameter: ‘resource’.
Trace ID: 1ac417ad-95f1-4cb2-aa3e-1dd21d756c00
Correlation ID: cffe5c56-be40-4603-b097-6d8f49727969
Timestamp: 2017-06-01 07:21:55Z
[error_codes] => Array
(
[0] => 90014
)

        [timestamp] => 2017-06-01 07:21:55Z
        [trace_id] => 1ac417ad-95f1-4cb2-aa3e-1dd21d756c00
        [correlation_id] => cffe5c56-be40-4603-b097-6d8f49727969
    )

[code] => 400
[content_type] => application/json; charset=utf-8

)
[2017-06-01 08:21:55][10129:][256:matrix error][R] (/packages/oauth2/oauth2_token/oauth2_token.inc:299) - There is no Access Token in response

Does anyone have any ideas how I can make it work?

One thing I though was to have a rest call trigger on login to get the token and set that as a session variable which probably work but as there is an Oauth asset type I’d much prefer to use that if possible.

Many thanks, Neil

Matrix Version: 5.3.4.0


(Bart Banda) #2

I’ve never tried connecting to Sharepoint manually like this, but we have fixed a couple of OAuth bugs since that version.

Does sharepoint offer OAuth authentication using the client side browser based method rather than 2 legged? (Using the OAuth2 Token asset)