Message Boards

Basic Authentication using email and password of logged in user

Upender Kashyap, modified 3 Years ago.

Basic Authentication using email and password of logged in user

Junior Member Posts: 30 Join Date: 8/12/20 Recent Posts

Hello,

I am trying to call Liferay commerce API which requires Basic Authentication. If I hardcode email password it works well, but I want to access Basic Authentication Base64 encoded credentials. Can anyone please let me know how can I access these in liferay.

 

Thanks

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Basic Authentication using email and password of logged in user

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi,

Basic Authentication Base64 encoded credentials - Needs to be formed using username and password  as below,

In Header you can pass below values 
Name - Authorization

Value -  Basic Base64(username:password)

You can refer below 

https://www.baeldung.com/httpclient-4-basic-authentication