HTTP Headers : Spring Basic Authentication via SoapUI

The rest endpoint developed in this blog is being called via SoapUI tool in this blog

Steps :

  • Note the name of the endpoint you want to call, example : http://localhost:9191/admin
  • Since we need to do a authentication we need to know the username and password in out case username is admin and password is admin
  • Now its base64 encode the credenticals
    • Arrange the credentials like username:password example admin:admin
    • encrypt the credentials using base64 encoder online
    • after encryption the value should look like YWRtaW46YWRtaW4=
    • Now add this value in header in this way
      Authorization : YWRtaW46YWRtaW4=
  • Check the method if it is get or post correctly

Example :

Tips :

  • Http error code is 401 then it is Authentication Failure
  • Http error code is 404 then it is page/resource not found
  • Check if the endpoint is a get or post
  • Check the if the header Authorization : Basic YWRtaW46YWRtaW4= is set correctly, decrypt YWRtaW46YWRtaW4= using base64 decoder and check
  • Check the console log of SpringBoot to check at which step of spring security it is failing

Leave a Comment