API Token Generation: Base64

Hi Team

Can you please help me to generate a token?
Encode your client key and client secret in the following format base64 ( $key + ":" + $secret )

Documentation: Quick Start & Token Generation | DUPR RaaS

I tried: encode("base64","$key+$secret") and encode("base64","$key+":"+$ecret")
Thanks

"Basic " & encode("Base64",[Username] &":" & [Pass])

"Basic " & encode("Base64",[key] &":" & [Secret])
BasicAuth.morph (2.7 KB)

Thanks @bolud

I got a token, but am getting an error

If I test it on Swagger UI and remove the word Basic before the code, then it returns successful on the website. It does not work in EasyMorph

Hi Rykie,

I have reviewed the contracts available on Swagger and the documentation you referenced earlier. Based on this analysis, here are the key implementation requirements:

  1. Use the correct authentication endpoint: Use the api/auth/v1.0/token method for token acquisition. The encoded key-secret value must be passed in the x-authorization header exactly as-is (do not add "Basic" prefix).
  2. Handle the Bearer token properly: The response will contain a Bearer token. You must extract this token and use it for all subsequent API calls.
  3. Configure the Authorization header correctly: Pass the obtained token in the Authorization header. The value must start with "Bearer " followed by a space. Format: Bearer XXX.

Important: You need to use different headers (x-authorization vs Authorization) depending on the authentication step you're currently executing.

Additional notes:

  • When navigating to https://uat.mydupr.com/api/swagger-ui/index.html#/Authentication/login, use the highlighted URL (e.g., POST /auth/{version}/token) in the WebRequest's Path field. Ensure you populate all required fields (in this case, the version parameter) before execution.
  • Configure your connector with the base path (https://uat.mydupr.com/api/) to eliminate redundant URL path segment duplication across WebRequests.
  • Validation step: Use Preview mode in EasyMorph WebRequest to compare your generated request against the one you create in Swagger. This will ensure accuracy.

You can try use
encode("Base64",[Username] &":" & [Pass])

Thank you @ckononenko. This worked well.
To use the token I had to add Bearer infront of the token.
I appreciate it that you took the time to sort this one for me.

Many thanks