REST API Digest access authentication

REST API Digest access authentication

  

Hi, I need to consume REST API with Digest Access Authentication.
I tried REST in Service Studio, but it seems only support Basic Access Authentication.

Is there any plugin or extension or at least sample apps for me to learn how to do it.

Thanks in advance.

Hi Harlin,

When consuming REST APIs you can implement other types of authentication by using the OnBeforeRequest / OnBeforeRequestAdvanced callbacks. These allow you to customize the requests before they are sent, so you can add the necessary headers for the authentication your service requires.

You can find many of examples on how these can be used to implement custom authentication to various services. Just search in the Forge for REST API, and you will find connectors to various popular SaaS and sites.

As for documentation you can find further details below:

Simple Customizations using OnBeforeRequest

Advanced Customizations using OnBeforeRequestAdvanced

Extensibility API for Extensions inside OnBeforeRequestAdvanced


About Digest Access Authentication, as far as I know there are no sample in the forge that implements it. From what I've read in https://en.wikipedia.org/wiki/Digest_access_authentication you will be able to implement this authentication these callbacks.

Share with us how it worked out, and if you want step into the spotlight submit a sample to our Forge!

Thanks!

Hi, thanks for the head-ups...

From the wiki, I will need MD5 function.

Can I use the built in GenerateSaltedMD5Hash?

Hello,

The builtin GenerateSaltedMD5Hash function will salt its input and hash it using the MD5 hash algorithm. Since there is a private salt being applied, the resulting MD5 hash will be different from the one Digest authentication mechanisms will be looking for.
To be perfectly clear, this function cannot be used for your intent and you will need to create an extension to achieve what you need.

This extension shouldn't be too hard to create, you can use the example in here to give you a head start.

Hope this helps,

Hello Harlin,

The CryptoAPI component has functions to produce hashes from strings.

Perhaps it can help you with this endeavor.