REST API Basic Authentication with Android Studio

  

Hi,

I am trying to send a GET request from my android application to the Outsystems REST API with Basic authentication. I am using Android Studio and Volley, and I am able to do so when there is no authentication. 

I have stumbled on to this post, https://www.outsystems.com/forums/discussion/12379/rest-basic-authentication/ and I am a little confused with how the headers are suppose to appear as I am sending mine in name value pairs. 

Am I suppose to send it as

"Name: " , "Authorization" as the first value pair and
"Value: " , "Basic " + Base64Encode(username + ":" + password)" as the second value pair?

Also, am I suppose to encode my username and password with Base64?

Thank you.

Regards,
Jerome 

  

Solution

Hi Gerome,


It's only one pair. "Authorization" is the name of the header and the rest is the value.

The value expression in your example looks correct. The spec of basic authentication is like that: the username and the password separated by a ":" encoded as Base64.


Regards,

João Rosado

Solution

João Rosado wrote:

Hi Gerome,


It's only one pair. "Authorization" is the name of the header and the rest is the value.

The value expression in your example looks correct. The spec of basic authentication is like that: the username and the password separated by a ":" encoded as Base64.


Regards,

João Rosado

Thanks João, it worked!