Forum Discussion

sp00ky's avatar
sp00ky
Occasional Contributor
4 years ago

ERROR: The request body must contain the following parameter: 'resource'.

Hi!

 

I want to authenticate against SharePoint Online and got the following error:

Fri Feb 26 10:43:08 CET 2021:ERROR:Failed to create the authorization URL
Fri Feb 26 10:43:08 CET 2021:ERROR:org.apache.oltu.oauth2.common.exception.OAuthSystemException: OAuthProblemException{error='invalid_request', description='AADSTS900144: The request body must contain the following parameter: 'resource'.

 

How can I add the parameter "resource" to OAuth2.0 parameters in SoapUI? Resource must be the same like scope.

OAuth 2 Flow = Client Credentials Grant

Client Identification = [client id]@[tenant id]

Client Secret = [client secret]

Access Token URI: https://accounts.accesscontrol.windows.net/[tenant id]/tokens/OAuth/2

Scope: 00000003-0000-0ff1-ce00-000000000000/[tenant name]@[tenant id]

 


Cheers
sp00ky

4 Replies

  • richie's avatar
    richie
    Community Hero
    Hey sp00ky,

    The error you have detailed indicates your request requires a payload and the payload is missing the resource parameter. The error is reported because your payload is missing a resource parameter, so youd need to update your request's MediaType (datatype/Content-Type header) to support including a payload 'application/x-www-form-urlencoded'

    and your payload would look something like the following:

    resource=someValue
    &client_id=someValue
    &client_secret=someValue
    &grant_type=client%20credentials

    Ta

    Rich
    • sp00ky's avatar
      sp00ky
      Occasional Contributor

      Hi!

      Understood so far, but how I can add this parameter in SoapUI to the authentication profile?

      Regards
      sp00ky

       

       

      • richie's avatar
        richie
        Community Hero
        Hey sp00ky,

        Sorry i lost your post and have only just seen it. Short answer is "i dont know". I didnt read your last post properly and made a false assumption that you had a payload. I suggest raising a support request with smartbear to determine the answer of how to supply the resource parameter if no one answers this post.
        Im also interested in the answer so when smartbear do respond, would you mind updating this post with the answer?

        Sorry i csnt be more help,
        Cheers,

        Rich