This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to create a REST flow with OAuth2 in OO?

I am unsure on how to create a REST flow with OAuth2 in OO, as the HTTP operations don't seem to have the proper input variables that I need for this.

For OAuth2, I e.g. have the following variables:

  • Ressource Owner Name
  • Ressource Owner Password
  • Client Identification
  • Client Secret
  • Access Token URI

In which operation and in which input-variables would I put all those variables in, so that OO can make a proper REST call using OAuth2?

Is there a sample flow for this somewhere in OO?

I have tried to use the sample flow "Get Auth Token" in Library->Integrations->Micro Focus ->Cloud OS, but I couldn't get it to work.

Any help would be greatly appreciated Slight smile

Tags:

Labels:

RPA
Parents
  • Verified Answer

    +1

    thank you all for your help Slight smile

    It wasn't the complete solution, but you showed me the right direction

    I managed to do it now with the following setup:

    I used the Operation from Base/Library/Operations/HTTP Client/v2.0/Http Client Post

    and then filled out the variables as follows (additional notes are in braces like this sentence):

    url = url for getting the oauth token

    authType = Basic

    username = Client Identification (this username will then be used for the Basic encoding as set by the authType)

    password = Client Secret (this password will then be used for the Basic encoding as set by the authType)

    preemtiveAuth = true (for testing purposes, to ensure the call goes through)

    trustAllRoots = true (again for testing purposes, to ensure the call goes through)

    x509HostnameVerifier = allow_all (again for testing purposes, to ensure the call goes through)

    headers = (nothing, leave this variable empty)

    responseCharacterSet = UTF-8 (this is by default some ISO-8859 and will most likely not work like this, so setting this to UTF-8 is really important!)

    body = grant_type=password&username=${ressource-owner-username}&password=${ressource-owner-password}    (here the "Ressource Owner Name" and the "Ressource Owner Password" are used as a variable within the entry for the body)

    contentType = application/x-www-form-urlencoded

    requestCharacterSet = UTF-8 (again, any other encoding will likely not work)

    method = POST

Reply
  • Verified Answer

    +1

    thank you all for your help Slight smile

    It wasn't the complete solution, but you showed me the right direction

    I managed to do it now with the following setup:

    I used the Operation from Base/Library/Operations/HTTP Client/v2.0/Http Client Post

    and then filled out the variables as follows (additional notes are in braces like this sentence):

    url = url for getting the oauth token

    authType = Basic

    username = Client Identification (this username will then be used for the Basic encoding as set by the authType)

    password = Client Secret (this password will then be used for the Basic encoding as set by the authType)

    preemtiveAuth = true (for testing purposes, to ensure the call goes through)

    trustAllRoots = true (again for testing purposes, to ensure the call goes through)

    x509HostnameVerifier = allow_all (again for testing purposes, to ensure the call goes through)

    headers = (nothing, leave this variable empty)

    responseCharacterSet = UTF-8 (this is by default some ISO-8859 and will most likely not work like this, so setting this to UTF-8 is really important!)

    body = grant_type=password&username=${ressource-owner-username}&password=${ressource-owner-password}    (here the "Ressource Owner Name" and the "Ressource Owner Password" are used as a variable within the entry for the body)

    contentType = application/x-www-form-urlencoded

    requestCharacterSet = UTF-8 (again, any other encoding will likely not work)

    method = POST

Children
No Data